Page 1 of 1

PgDAC 6.4.2 procedure parameters issue

Posted: Tue 06 Apr 2021 15:04
by AndreyD
TPgSQL does not recognize parameters in procedure calls, i.e:

call somefunction(:param) raises exception "there is no parameter $1".

In the PgDAC 5.3 it worked fine.

PostgreSQL 11.11, Delphi 7.

Re: PgDAC 6.4.2 procedure parameters issue

Posted: Thu 08 Apr 2021 17:38
by oleg0k
Hello,
Unfortunately, we couldn't reproduce the issue.
Please send us an example that uses PgDAC and demonstrates the incorrect behavior, along with DDL scripts for creating and populating the database objects. Please send them through the form on our website: https://devart.com/company/contactform.html

wbr, Oleg
Devart Team

Re: PgDAC 6.4.2 procedure parameters issue

Posted: Wed 04 Aug 2021 09:32
by damos
Hi i have the same error when using TPgsSql with simple params like

InsertExternal='insert into fexternals '+
'(labowner,ip,server,analyserid,analysername,isactive,maxracks,startrack,maxrackpos,barcode,path,alerter,labname,tguid)'+
'values (:a,:b,:c,:d,:e,:f,:h,:g,:k,:l,:s,:x,:labname,:tguid)';

AddExternal.sql.text:=InsertExternal;

AddExternal.Params[0].value:=QComports.FieldByName('labowner').value;
AddExternal.Params[1].value:=common.Hostaddress;
AddExternal.Params[2].value:=common.Hostname;
AddExternal.Params[3].value:=QComports.FieldByName('analyserid').value;
AddExternal.Params[4].value:=QComports.FieldByName('analysername').value;
AddExternal.Params[5].value:=QComports.FieldByName('autoopen').value;
AddExternal.Params[6].value:=QComports.FieldByName('maxracks').value;
AddExternal.Params[7].value:=QComports.FieldByName('rackstartnumber').value;
AddExternal.Params[8].value:=QComports.FieldByName('maxrackpositions').value;
AddExternal.Params[9].value:= QComports.FieldByName('barcodepriority').value;
AddExternal.Params[10].value:= '\\'+common.Hostname+'\Data' ;
AddExternal.Params[11].value:=QComports.FieldByName('uploaddata').value;
AddExternal.Params[12].value:= QComports.FieldByName('labname').value;
AddExternal.Params[13].value:=QComports.FieldByName('tguid').value;
try
if not AddExternal.Prepared
then
AddExternal.prepare;

AddExternal.Execute;
except
On E:EXception do
Begin
if E is EdAerror then
errorlb.Caption:='Database error '+E.Message
else
errorlb.Caption:='General error '+E.Message
End;
end;// except

raises exception "there is no parameter $1"
if i replace AddExternal with a TPGQuery with same params values there is no problem
i am using DELPHI XE10.4.2 Sydney, PGdac version 6.4.3 on Windows 10
this was not happen with prior versions like 6.3.1 Delphi XE10.3.3 on Windows 10

Re: PgDAC 6.4.2 procedure parameters issue

Posted: Thu 05 Aug 2021 04:36
by evgeniym
Hi Damos!
Thank you for letting us know!
We have closely checked and unfortunately, we could not reproduce the issue at our end.
Could you please send us a sample which uses PgDAC and demonstrates the incorrect behavior, along with DDL scripts for creating and populating the database objects?
Please send them through the form on our website: https://devart.com/company/contactform.html
Should you have any questions, do not hesitate to ask!
Best regards,
Evgeniy