Pl Pgsql problem

From: "lihao" <lihao(at)sageway(dot)com(dot)sg>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Pl Pgsql problem
Date: 2003-04-28 09:15:16
Message-ID: 001101c30d66$b00356e0$f301a8c0@pc66
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2003-04-28 09:20:11 Re: Pl Pgsql problem
Previous Message Tomasz Myrta 2003-04-28 08:54:00 Re: Pl Pgsql problem