Script component ignores error?

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Script component ignores error?

Post by upscene » Mon 28 Sep 2015 10:28

Hi,

When executing this in a TIBCScript component, the OnError event isn't triggered.

Code: Select all

execute block returns (id int)
as begin
 execute statement 'dasdasda';
 suspend;
end
When executing this inside a TIBCQuery, an error is raised properly.

Any idea?

With regards,

Martijn Tonies
Upscene Productions

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Script component ignores error?

Post by ViktorV » Wed 30 Sep 2015 08:31

In your example, the execute block construct has a return value (returns (id int)), so TIBCQuery will execute it as a SELECT statement, and that will cause an error when trying to get the result. In TIBCScript, the error does not occur, since it is not designed to return the results of executed statements.
To verify this, you can remove the "returns (id int)" construct in your example, and the error will occur in both TIBCQuery and TIBCScript.

Post Reply