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 » Create Table with Sqlite
Re: Create Table with Sqlite [message #12239 is a reply to message #12238] Sat, 20 October 2007 13:09 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14266
Registered: November 2005
Ultimate Member
Alex wrote on Sat, 20 October 2007 06:40

Hi,
I work for a few months with upp and now I have a problem with sqlite:

Sql sqlVer;
Sql sqlRaum;
Sql sqlNew;
	
sqlVer * Select(RAUMID).From(VERANST).Where(VID == id);
sqlRaum * Select(SEKTION,REIHE,PLATZ,PREISGR,XDISPL,YDISPL,COLDISPL).From(RAUMPLAN).Where(RNR == sqlVer[RAUMID]);
String TableName = Format("%08d",id);

String s = "CREATE TABLE V" + TableName; 
	s += " (ID integer primary key autoincrement , SEKTION integer, REIHE integer,";
	s += " PLATZ integer, PREISGR integer, XDISPL integer, YDISPL integer, COLDISPL integer)";

sqlNew.Execute(s);



Generates a error:

ERROR SQL logic error or missing database(0): CREATE TABLE V00000013 (ID integer primary key autoincrement , SEKTION integer, REIHE integer, PLATZ integer, PREISGR integer, XDISPL integer, YDISPL integer, COLDISPL integer)
ERROR database table is locked(0): Resetting statement: CREATE TABLE V00000013 (ID integer primary key autoincrement , SEKTION integer, REIHE integer, PLATZ integer, PREISGR integer, XDISPL integer, YDISPL integer, COLDISPL integer)



Can someone please tell me what is wrong here.

Thanks in advance,

Alex



Well, I guess this really is not an U++ problem, but some issue with your SQL and/or Sqlite. My first wild guess is that the table already exists in the database. Try DROP TABLE first to find out...

Mirek
 
Read Message
Read Message
Read Message
Read Message icon7.gif
Read Message
Read Message
Previous Topic: Example code for CtrLib/Sqlite needed
Next Topic: How to use Clipboard in HomeBudget(SqLite3)?
Goto Forum:
  


Current Time: Fri Jul 18 03:36:13 CEST 2025

Total time taken to generate the page: 0.04019 seconds