Can I use execute block with TIBCQuery ?

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
inageib
Posts: 184
Joined: Wed 26 Aug 2009 14:11

Can I use execute block with TIBCQuery ?

Post by inageib » Tue 22 Jan 2013 04:35

Hi,
I use Firebird 2.5 and I wonder if I can use EXECUTE BLOCK as the Select SQL for TIBCQuery ? and I also I can edit/insert/delete ?

Thanks

AndreyZ

Re: Can I use execute block with TIBCQuery ?

Post by AndreyZ » Tue 22 Jan 2013 08:21

Hello,

Firebird supports the EXECUTE BLOCK statement since version 2.0. As you are using Firebird 2.5, you can use the EXECUTE BLOCK statement. Here is a code example:

Code: Select all

IBCQuery1.SQL.Clear;
IBCQuery1.SQL.Add('EXECUTE BLOCK');
IBCQuery1.SQL.Add('AS');
IBCQuery1.SQL.Add('BEGIN');
IBCQuery1.SQL.Add('INSERT INTO DEPT(DEPTNO, DNAME, LOC) VALUES(60, ''testname'', ''testloc'');'); // the dept table has three columns: DEPTNO INTEGER, DNAME VARCHAR(14), LOC VARCHAR(13)
IBCQuery1.SQL.Add('END');
IBCQuery1.Execute;
For more information about the EXECUTE BLOCK statement, please read the following article: http://www.firebirdsql.org/refdocs/lang ... block.html

inageib
Posts: 184
Joined: Wed 26 Aug 2009 14:11

Re: Can I use execute block with TIBCQuery ?

Post by inageib » Tue 22 Jan 2013 12:17

Many Thanks Andrey

AndreyZ

Re: Can I use execute block with TIBCQuery ?

Post by AndreyZ » Tue 22 Jan 2013 12:44

Always glad to help.

Post Reply