Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » SQLITE Insert or Replace
Re: SQLITE Insert or Replace [message #47909 is a reply to message #47900] Sat, 22 April 2017 15:27 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1791
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi rxantos,

rxantos wrote on Thu, 20 April 2017 14:44
Is it possible to do an "INSERT OR REPLACE INTO" query using U++?


That is sqlite syntax, right? Quick and dirty solution is to add the "or replace" part into the query:
SqlStatement OrReplace(const SqlInsert& insert) {
	String s = SqlStatement(insert).Get(SQLITE3);
	ASSERT(s.StartsWith("insert "));
	s = "insert or replace " + s.Mid(7);
	return SqlStatement(s);
}

The same could be of course done for any other dialect as well, as long as you respect the supported SQL syntax.

Best regards,
Honza
 
Read Message
Read Message
Previous Topic: OleDB fails to build
Next Topic: Please Help Me
Goto Forum:
  


Current Time: Wed May 14 17:00:01 CEST 2025

Total time taken to generate the page: 0.02498 seconds