Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Parameters are not prepared in some cases (PostgreSQL)



Permlink Replies: 1 - Last Post: Jul 9, 2017 1:17 PM Last Post By: Dmitry Arefiev
Dmitry Vavilov

Posts: 21
Registered: 2/22/15
Parameters are not prepared in some cases (PostgreSQL)
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 7, 2017 1:12 AM
Hi!
If use a query, for example,
do
$$
DECLARE v_BegDat TimeStamp;
begin
  v_BegDat := :BegDat;
  perform v_BegDat as result;
end;
$$;

then the parameter (BegDat) is determined and i can configure it. But when the query is executed, a "[FireDAC][Phys][libpq] ОШИБКА: ошибка синтаксиса (примерное положение ":")." error occurs. Most likely the parameter value is not substituted into the final query.
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Parameters are not prepared in some cases (PostgreSQL)
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 9, 2017 1:17 PM   in response to: Dmitry Vavilov in response to: Dmitry Vavilov
PostgreSQL does not support parameters inside of anonymous block. You should create function instead.

--
With best regards,
Dmitry
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02