Delete with conditon problem

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
iancoullie
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 05.02.2018, 00:27

Delete with conditon problem

Post by iancoullie »

Hi All
Im using 7.2.4-stable with Delphi Berlin starter 10.1
Code:
DM.ZConnection1.Connected := true;
DM.InfoSQL.SQL.Clear;
DM.InfoSQL.SQL.Add('DELETE FROM aInfo WHERE SUPPLIER_NAME = ''Lovato''');
DM.InfoSQL.ExecSQL;
// DM.InfoSQL.Active := true;

If i leave out the WHERE condition the delete works and emptys the table

with the WHERE condition I get the following error
SQL Error: SQL logic error or missing database.

if I run the 'DELETE FROM aInfo WHERE SUPPLIER_NAME = 'Lovato'
in SQLStudio it works

Ive tried the DM.InfoSQL.Active := true; and get the same error
DM.InfoSQL connection is set in its properties to DM.ZConnection1
All other values on the connection and Query component are default.

Thanks in advance for any advice
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Delete with conditon problem

Post by marsupilami »

Hello :)

Which database do you use? Currently I am guessing SQLite. If it is SQLite it might make sense to try Zeos 7.3 SVN because it has better error reporting for SQLite than Zeos 7.2. You can also try Zeos 7.2 from SVN and set the parameter ExtendedErrorMessage to 1 or Yes or true to get the extended error information.
iancoullie
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 05.02.2018, 00:27

Re: Delete with conditon problem

Post by iancoullie »

Hi marsupilami :D

Thanks for that. Yes its SQLite. Ill upgrade and see what happens. Much appreciated.
iancoullie
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 05.02.2018, 00:27

Re: Delete with conditon problem

Post by iancoullie »

Hi marsupilami :D

The extended error message is

SQL Error: Error: SQL logic error or missing database

Message: no such collation sequence: SYSTEMNOCASE.

The table was generated by a Mormot server with this Collation. Is there a way to add support for this collation

Thanks
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Delete with conditon problem

Post by marsupilami »

Hello iancoullie,

duh - it seems that Mormot has registered its own collation with that database: https://www.sqlite.org/faq.html#q18. So you probably will have to register it from your Zeos application as well or use Mormot for accessing the data.

I am not sure if we currently expose the required functions for registering custom collations with SQLite I have to check that. SYSTEMNOCASE uses a Mormot specific function. See Mormot SynSQLite3.pas

Best regards,

Jan
iancoullie
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 05.02.2018, 00:27

Re: Delete with conditon problem

Post by iancoullie »

Thanks Jan

I use the zeos component in a tiny app that updates data daily from a variety of XLS spreadsheets.
The app was previously connected to a firebird database and i am changing it to SQLite.
The irony is that the error only occurs with a delete with condition. The full delete works and the insert works.

Ill weigh up my options.

Thanks for your help
iancoullie
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 05.02.2018, 00:27

Re: Delete with conditon problem

Post by iancoullie »

Hi Jan

Problem solved. I dropped the table and recreated without the collation.
As these are small tables and i have not noticed a speed drop when connecting with the mormot server.

Thanks very much
Post Reply