Home » U++ Library support » U++ SQL » sqlite and Execute
Re: sqlite and Execute [message #25869 is a reply to message #25860] |
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.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
Goto Forum:
Current Time: Thu May 09 16:43:58 CEST 2024
Total time taken to generate the page: 0.02054 seconds
|