Hi,
I am using 7.1.3 on RedHat Linux 7.2.
I try to create a trigger on the table, I wrote a function in plpgsql,
which always fail on this sql command:
select (''UPD'' || int2hex(nextval(''updid''), 8)) as v_updid;
The function is like this:
begin
select (''UPD'' || int2hex(nextval(''updid''), 8)) as
v_updid;
if not found then
raise exception ''Unable to get updid.'';
end if;
end;
It give me this error when I trigger the function:
NOTICE: Error occurred while executing PL/pgSQL function
pg_fct_bf_ins_inf_article
NOTICE: line 9 at SQL statement -- the SQL select command
ERROR: parser: parse error at or near "$1"
I can execute the SQL without problem.
<<
select ('UPD' || int2hex(nextval('updid'), 8)) as v_updid;
>>
Can anyone help me to see what is the problem here.
Li Hao