ZUpdateSQL and SQLite. Params missing
Posted: 30.09.2008, 08:34
Hi there,
sorry if this isn't an error but my fault, as I'm quite new in the Zeos library (I use 6.3.3 stable with Delphi 6 Enterprise French).
I have a ZConnection on a SQLite-3 protocol. I've a Zquery with inner and left joins on 3 tables and I've attached a ZUpdateSQL to it. I've generated the SQL for the field I'm interested to update and I've attached a TDbGrid to the datasource attached to the ZQuery.
Now when I change the field in the column that can be changed by the QUpdateSQL and I leave the row, I get a message error:
SQL Error: SQL logic error or missing database.
I've added a SQLmonitor to see what's appening:
2008-09-30 09:20:50 cat: Connect, proto: sqlite-3, msg: CONNECT TO "C:\programmes\follomi\db.s3db" AS USER ""
2008-09-30 09:20:50 cat: Execute, proto: sqlite-3, msg: select categories.nomcategorie, souscategories.nomsouscategorie, sum(articles.qtestock) as totalstock, souscategories.estachat from categories
inner join souscategories on categories.idcategorie = souscategories.idcategorie
left join articles on souscategories.idsouscategorie = articles.idsouscategorie
group by souscategories.idsouscategorie
order by categories.idcategorie, souscategories.idsouscategorie
2008-09-30 09:20:51 cat: Execute, proto: sqlite-3, msg: PRAGMA table_info('categories')
2008-09-30 09:20:51 cat: Execute, proto: sqlite-3, msg: PRAGMA table_info('souscategories')
2008-09-30 09:20:51 cat: Execute, proto: sqlite-3, msg: PRAGMA table_info('articles')
2008-09-30 09:20:54 cat: Execute, proto: sqlite-3, msg: UPDATE souscategories SET souscategories.estachat = NULL WHERE souscategories.idsouscategorie = NULL, errcode: 1, error: SQL logic error or missing database
The update SQL in ZUpdateSQL is:
UPDATE souscategories SET
souscategories.estachat = :estachat
WHERE
souscategories.idsouscategorie = :OLD_idsouscategorie
As you can see, idsouscategorie and estachat are NULL. Don't know what I do wrong.
If anybody could help me...Thank you.
Regards
sorry if this isn't an error but my fault, as I'm quite new in the Zeos library (I use 6.3.3 stable with Delphi 6 Enterprise French).
I have a ZConnection on a SQLite-3 protocol. I've a Zquery with inner and left joins on 3 tables and I've attached a ZUpdateSQL to it. I've generated the SQL for the field I'm interested to update and I've attached a TDbGrid to the datasource attached to the ZQuery.
Now when I change the field in the column that can be changed by the QUpdateSQL and I leave the row, I get a message error:
SQL Error: SQL logic error or missing database.
I've added a SQLmonitor to see what's appening:
2008-09-30 09:20:50 cat: Connect, proto: sqlite-3, msg: CONNECT TO "C:\programmes\follomi\db.s3db" AS USER ""
2008-09-30 09:20:50 cat: Execute, proto: sqlite-3, msg: select categories.nomcategorie, souscategories.nomsouscategorie, sum(articles.qtestock) as totalstock, souscategories.estachat from categories
inner join souscategories on categories.idcategorie = souscategories.idcategorie
left join articles on souscategories.idsouscategorie = articles.idsouscategorie
group by souscategories.idsouscategorie
order by categories.idcategorie, souscategories.idsouscategorie
2008-09-30 09:20:51 cat: Execute, proto: sqlite-3, msg: PRAGMA table_info('categories')
2008-09-30 09:20:51 cat: Execute, proto: sqlite-3, msg: PRAGMA table_info('souscategories')
2008-09-30 09:20:51 cat: Execute, proto: sqlite-3, msg: PRAGMA table_info('articles')
2008-09-30 09:20:54 cat: Execute, proto: sqlite-3, msg: UPDATE souscategories SET souscategories.estachat = NULL WHERE souscategories.idsouscategorie = NULL, errcode: 1, error: SQL logic error or missing database
The update SQL in ZUpdateSQL is:
UPDATE souscategories SET
souscategories.estachat = :estachat
WHERE
souscategories.idsouscategorie = :OLD_idsouscategorie
As you can see, idsouscategorie and estachat are NULL. Don't know what I do wrong.
If anybody could help me...Thank you.
Regards