Prepared changes to False after ExecSQL

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for InterBase & Firebird in Delphi and C++Builder
Post Reply
Peca
Posts: 4
Joined: Sun 30 Sep 2007 21:56

Prepared changes to False after ExecSQL

Post by Peca » Sat 29 Jan 2011 20:42

Hi,
I use dbExpress with dbxida(2.2) with TSQLQuery. When I create prepared query and set it to prepare, after first call ExecSQL my TSQLQuery chages its Prepared status to False.

I tried change CQLConnection param Prepared, but without success.

Can anybody tell me what to do to save Prepared state?

var
QInsert:TSQLQuery;
S: String;
I:Integer;
begin
S := 'insert into PERSONS ('+
' PERSONNUM1'+
', PERSONNUM'+
') values ('+
' :PERSONNUM1' +
', :PERSONNUM'+
')';

if not Assigned(QInsert) then
begin
QInsert:= TSQLQuery.Create(nil);
QInsert.SQLConnection:=con1;
con1.Params.Values['Prepared'] := 'True'; //do nothing

QInsert.SQL.Add(S);
QInsert.Prepared:= True;
end;

for I := -1 downto -3 do
begin
QInsert.ParamByName('PERSONNUM1').AsInteger:= I;
QInsert.ParamByName('PERSONNUM').AsString:= 'xxx'+ InttoStr(I);
QInsert.ExecSQL; // after first execute sets prepare to false
end;




Thanks-

AndreyZ

Post by AndreyZ » Tue 01 Feb 2011 10:52

Hello,

I cannot reproduce the problem. Please try composing a small sample to demonstrate the problem and send it to andreyz*devart*com.

AndreyZ

Post by AndreyZ » Thu 10 Feb 2011 12:19

I have answered you by e-mail.

Post Reply