Page 1 of 1
Can I use execute block with TIBCQuery ?
Posted: Tue 22 Jan 2013 04:35
by inageib
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
Re: Can I use execute block with TIBCQuery ?
Posted: Tue 22 Jan 2013 08:21
by AndreyZ
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
Re: Can I use execute block with TIBCQuery ?
Posted: Tue 22 Jan 2013 12:17
by inageib
Many Thanks Andrey
Re: Can I use execute block with TIBCQuery ?
Posted: Tue 22 Jan 2013 12:44
by AndreyZ
Always glad to help.