Syntax error - Multiple commands

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
doidopb
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 01.12.2012, 19:52

Syntax error - Multiple commands

Post by doidopb »

Hi,

I use the zeos 6.6.2-RC, Delphi 7 and Mysql 5.0.45. I'm trying to run multiple commands at once, example:

z_command.SQL.add('UPDATE SCE2_ESTQUIMI SET quant_nf = quant_nf + ' + 1 WHERE codigo = "200";');
z_command.SQL.add('UPDATE SCE2_ESTQUIMI SET quant_nf = quant_nf + ' + 1 WHERE codigo = "201";');
z_command.SQL.add('UPDATE SCE2_ESTQUIMI SET quant_nf = quant_nf + ' + 1 WHERE codigo = "202";');

z_command.ExecSQL;

Does not work, I get an error SQL Syntax, but HeidiSQL the functions normally.

Does anyone know how to do???

Thanks
josimarz
Junior Boarder
Junior Boarder
Posts: 41
Joined: 14.09.2009, 17:29
Location: Brazil

Post by josimarz »

Hello,

Use a TZSQLProcessor component to run multiple SQL statements.

Bye,

Josimar
Wild_Pointer
Expert Boarder
Expert Boarder
Posts: 164
Joined: 18.03.2008, 13:03
Contact:

Post by Wild_Pointer »

Hello,

the other solution is to change the SQL to:

Code: Select all

UPDATE SCE2_ESTQUIMI SET quant_nf = quant_nf + 1 WHERE codigo IN (200, 201, 202)
That should increase the speed of your application.

Good luck!
Post Reply