pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: lihao <lihao@sageway.com.sg>
To: pgsql-sql@postgresql.org
Subject: Pl Pgsql problem
Date: Mon, 28 Apr 2003 17:15:16 +0800
Message-ID: <001101c30d66$b00356e0$f301a8c0@pc66> (raw)

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
 

view thread (5+ messages)  latest in thread

Message-ID: <001101c30d66$b00356e0$f301a8c0@pc66>
Permalink:  ../001101c30d66$b00356e0$f301a8c0@pc66/
Also on:    postgresql.org/message-id/001101c30d66$b00356e0$f301a8c0@pc66

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lihao@sageway.com.sg
  Subject: Re: Pl Pgsql problem
  In-Reply-To: <001101c30d66$b00356e0$f301a8c0@pc66>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox