[Lazarus] Postgresql error

Koenraad Lelong lazarus2 at de-brouwerij.be
Mon Aug 5 11:19:04 CEST 2013


Hi,

I can't find out why I get this error in my application :
EPQDatabase Error
pqMyServer1 : Preparation of query failed (PostgreSQL:ERROR: prepared 
statement "prepst0" already exists)
Severity : ERROR
SQL State : 42P05

I'm using a TPQConnection, and I can make it active.
My TSQLQuery.SQL (pqQuery2) is this :
UPDATE mydbcarrview_10.carrier_magname
SET location = :location
where carrierid = :carrierid

Then I do this :

  with Datamodule1 do
   begin
//    pqQuery2.UnPrepare; <-- does not help
     pqQuery2.ParamByName('Location').AsString:=edtLocation.Text;
     pqQuery2.ParamByName('CarrierId').AsString:=edtCarrierId.Text;
     try
       pqQuery2.ExecSQL; <-- gives the error
       pgTransaction1.Commit;
     except
       on e:exception do
        begin
         showmessage(e.Message);
         pgTransaction1.Rollback;
        end;
     end;
   end;

pqQuery2.UpdateMode was UpWhereKeyOnly, and I tried UpWhereAll, with the 
same error as result.

Lazarus 1.08, fpc 2.6.2 on winXP-32 bit.

What am I doing wrong ?

Thanks,

Koenraad Lelong




More information about the Lazarus mailing list