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 » 607-Dev3 Errors (worked previously) [SOLVED]
607-Dev3 Errors (worked previously) [SOLVED] [message #4305] Tue, 01 August 2006 00:24 Go to next message
rbmatt is currently offline  rbmatt
Messages: 90
Registered: July 2006
Location: Tennesse, USA
Member

I updated to dev3 and now my import and export does not work. I get the following error in my buglog file:
ERROR SQL logic error or missing database: insert into CUSTOMERS(ID,NAME,ADDRESS,CSZ,PHONE1,PHONE2,UNIT_INFO,NOTES, CURRENT,SERVICE) values(?,?,?,?,?,?,?,?,?,?)
ERROR PRIMARY KEY must be unique: Resetting statement: insert into CUSTOMERS(ID,NAME,ADDRESS,CSZ,PHONE1,PHONE2,UNIT_INFO,NOTES, CURRENT,SERVICE) values(?,?,?,?,?,?,?,?,?,?)

Now I checked to see what ID's I was inserting, and they are numeric starting with 1 and going to over 3000.
Now it does actually try to insert some stuff. I'm getting partial fields in there.
For example, "Abbott, Don" goes in as just "Abbot"
and "Abercrombie, Kathy" goes in as "Abercromb"

I downgraded to dev2 and all works ok. So this is a regression.

I can privately e-mail you my app and a sample dataset if you need it to debug.

Thanks.

[Updated on: Wed, 02 August 2006 02:49] by Moderator

Report message to a moderator

Re: 607-Dev3 Errors (worked previously) [message #4307 is a reply to message #4305] Tue, 01 August 2006 02:48 Go to previous messageGo to next message
aroman is currently offline  aroman
Messages: 18
Registered: November 2005
Promising Member

We updated the sqlite plugin to version 3.3.6, which is not compatible with databases from the earlier version of 3.2.7. If you are using the same database file, it won't work.

If you are not using the same database file, then something else is wrong...

- Augusto
Re: 607-Dev3 Errors (worked previously) [message #4308 is a reply to message #4307] Tue, 01 August 2006 04:00 Go to previous messageGo to next message
rbmatt is currently offline  rbmatt
Messages: 90
Registered: July 2006
Location: Tennesse, USA
Member

aroman wrote on Mon, 31 July 2006 20:48

We updated the sqlite plugin to version 3.3.6, which is not compatible with databases from the earlier version of 3.2.7. If you are using the same database file, it won't work.

If you are not using the same database file, then something else is wrong...

- Augusto


Brand new database, importing from a plaintext, tab separated file.
I had also updated my dev2 sqlite as per the forum instructions- that makes me think its something else.
My syntax is like:
Sql insert("insert into CUSTOMERS(ID,NAME,ADDRESS,CSZ,PHONE1,PHONE2,UNIT_INFO,NOTES,CURRENT,SERVICE) values(?,?,?,?,?,?,?,?,?,?)");
...
Vector<String> field = Split(in.GetLine(), '\t', false);
insert.Run(field[0],field[1],field[2],field[3],field[4],field[5],field[6],field[7],field[8],field[9]);

Again, I verified that my field[0] (which is integer primary key) is giving unique integers.
Re: 607-Dev3 Errors (worked previously) [message #4309 is a reply to message #4308] Tue, 01 August 2006 04:28 Go to previous messageGo to next message
rbmatt is currently offline  rbmatt
Messages: 90
Registered: July 2006
Location: Tennesse, USA
Member

I've found out its not just my code.
reference/SQL_SQLite3 gives the same error (if you fix line 79 to be bdate instead of date).
Sql insert("insert into SIMPLE_TEST1(name,bdate) values(?,?)",sqlite3);
	insert.Run("joseph",19990101);
	insert.Run(  "neel",19990102);
	insert.Run(   "bob",19990103);
	insert.Run(    "al",19990104);


ERROR SQL logic error or missing database: insert into SIMPLE_TEST1(ID, NAME, LASTNAME, BDATE) values (0, 'Joe', 'Smith', 20000101)
ERROR PRIMARY KEY must be unique: Resetting statement: insert into SIMPLE_TEST1(ID, NAME, LASTNAME, BDATE) values (0, 'Joe', 'Smith', 20000101)
ERROR SQL logic error or missing database: insert into SIMPLE_TEST1(ID, NAME, LASTNAME, BDATE) values (1, 'Mike', 'Smith', 20000102)
ERROR PRIMARY KEY must be unique: Resetting statement: insert into SIMPLE_TEST1(ID, NAME, LASTNAME, BDATE) values (1, 'Mike', 'Smith', 20000102)
ERROR SQL logic error or missing database: insert into SIMPLE_TEST1(ID, NAME, LASTNAME, BDATE) values (2, 'Jon', 'Goober', 20000103)
ERROR PRIMARY KEY must be unique: Resetting statement: insert into SIMPLE_TEST1(ID, NAME, LASTNAME, BDATE) values (2, 'Jon', 'Goober', 20000103)
Re: 607-Dev3 Errors (worked previously) [message #4319 is a reply to message #4309] Tue, 01 August 2006 09:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, about "truncating" strings: My fault. Please change SqlLite3.cpp line 145 to

sqlite3_bind_text16(current_stmt,i,p,2*p.GetLength(),SQLITE_ TRANSIENT);

(2*p.GetLength() - Sqlite wants number of bytes, not number of characters here....)

As for insert error, I have not encountered it. However, please check if you delete .db file to delete .sql script files as well - otherwise U++

sch.ScriptChanged(SqlSchema::UPGRADE)

would think there are no changes to schema and would not recreate the database.

Mirek
Re: 607-Dev3 Errors (worked previously) [message #4335 is a reply to message #4319] Tue, 01 August 2006 17:10 Go to previous messageGo to next message
rbmatt is currently offline  rbmatt
Messages: 90
Registered: July 2006
Location: Tennesse, USA
Member

luzr wrote on Tue, 01 August 2006 03:30

As for insert error, I have not encountered it. However, please check if you delete .db file to delete .sql script files as well - otherwise U++

sch.ScriptChanged(SqlSchema::UPGRADE)

would think there are no changes to schema and would not recreate the database.

It was a brand new database from a brand new debug folder (I let the installer completely wipe c:\upp). The exact same happened on the reference example, so I don't think it's anything to do with that. I'll try though.
Re: 607-Dev3 Errors (worked previously) [message #4336 is a reply to message #4335] Tue, 01 August 2006 18:10 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
For me, reference example works OK...

Mirek
Re: 607-Dev3 Errors (worked previously) [message #4339 is a reply to message #4336] Wed, 02 August 2006 02:34 Go to previous message
rbmatt is currently offline  rbmatt
Messages: 90
Registered: July 2006
Location: Tennesse, USA
Member

It must have been related to the first problem... seems to work now.
Thanks for looking into it.
Previous Topic: SqlArray Insert
Next Topic: SqlArray row validation bug
Goto Forum:
  


Current Time: Sun Apr 28 22:15:54 CEST 2024

Total time taken to generate the page: 0.04076 seconds