U++ framework
Do not panic. Ask here before giving up.

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: 1796
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: Sun Apr 26 13:36:21 GMT+2 2026

Total time taken to generate the page: 0.00479 seconds