Script without end delimiter
Posted: 09.04.2006, 14:03
Hi,
I have a little design question. If I feed a query without end delimiter to a TZSQLprocessor it does not execute this query. That's because when he parses the string the StementCount is 0.
So this code does nothing :
You may say, 'set id=1 where id = 1' does nothing. Well, in my opinion at least it should send an update statement to the server. (I do that to check whether the user has update rights.)
Another possible remark is : 'You're lazy... Just put a delimiter.' That's also right. But you can debug quite a time as there's no error but no result.
So I have a poll : Should statements not ending in a delimiter at the end of a script be executed by a TZSqlProcessor or not?
I have a little design question. If I feed a query without end delimiter to a TZSQLprocessor it does not execute this query. That's because when he parses the string the StementCount is 0.
So this code does nothing :
Code: Select all
Updater.Clear;
Updater.Script.Append('Update Cfg set id=1 where id = 1');
Updater.Execute;
Another possible remark is : 'You're lazy... Just put a delimiter.' That's also right. But you can debug quite a time as there's no error but no result.
So I have a poll : Should statements not ending in a delimiter at the end of a script be executed by a TZSqlProcessor or not?