Pl Pgsql problem - Mailing list pgsql-sql

From lihao
Subject Pl Pgsql problem
Date
Msg-id 001101c30d66$b00356e0$f301a8c0@pc66
Whole thread Raw
Responses Re: Pl Pgsql problem
List 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

 

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Second maximum value
Next
From: Tomasz Myrta
Date:
Subject: Re: Pl Pgsql problem