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 #25869 is a reply to message #25860] Tue, 16 March 2010 22:24 Go to previous messageGo to previous message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

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 );
}
 
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 16:43:58 CEST 2024

Total time taken to generate the page: 0.02054 seconds