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 and Execute
Re: sqlite and Execute [message #25870 is a reply to message #25869] Tue, 16 March 2010 23:21 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
sergeynikitin wrote on Tue, 16 March 2010 22:24

Try as this code
c16::c16()
{
	CtrlLayout(*this, "Window title");

    Sqlite3Session sqlite3;
    if(!sqlite3.Open(ConfigFile("c16.db"))) {
        Exclamation("Can't create or open database file");
        return;
    }

//#ifdef _DEBUG
    sqlite3.SetTrace();
//#endif
SQL = sqlite3;
SQL.Execute("INSERT INTO PUNTI_GIOCATORI (IDCIRCOLO,SIGLAPROV,SIGLAREG) SELECT IDCIRCOLO,SIGLAPROV,SIGLAREG FROM ISCRITTI;");

	btnFill.WhenPush = THISBACK(FillRankingTables); 
	

	
}


It seems that you are adding records to the database and violate the unique key. Similar entries being added keys are already present in the database. It is necessary to exclude from the query a key field. For SQL Server is not important, but with SqLite such a conflict arises.


Thank you for your effort.
Unfortunatly it does not work.
I tried even to drop the table PUNTI_GIOCATORI and create a new one without primary key.
The weird thing is that the same instruction is parsed correctly by sqlitemanager and fill the table as expected.

I will try to break the instruction in two easy ones in the next days. I suspect there is some strange behaviour in the sqlite package.

Poka,
Luigi
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Workaround: Hybridizing SqlExp usage
Next Topic: sqlite busy/lock timeout patch
Goto Forum:
  


Current Time: Thu May 09 11:48:45 CEST 2024

Total time taken to generate the page: 0.01780 seconds