From: lihao <lihao@sageway.com.sg>
To: 'Tomasz Myrta' <jasiek@klaster.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Pl Pgsql problem
Date: Mon, 28 Apr 2003 18:14:29 +0800
Message-ID: <001901c30d6e$f4849880$f301a8c0@pc66> (raw)
In-Reply-To: <3EACF24B.5050502@klaster.net>
Hi,
What I try to get is
venus=# select ('UPD' || int2hex(nextval('updid'), 8)) as v_updid;
v_updid
-------------
UPD0000145C
(1 row)
updid is a sequence. I am try to generate a index with character and
sequence number.
Anyway, I solve it by change the script to :
select (''UPD'' || int2hex(nextval(''updid''), 8)) into v_updid;
Thank you.
Li Hao
-----Original Message-----
From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Tomasz Myrta
Sent: Monday, April 28, 2003 5:20 PM
To: lihao
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Pl Pgsql problem
Dnia 2003-04-28 11:29, Uz.ytkownik lihao napisa?:
> So the Line 9 is this line:
> select (''UPD'' || int2hex(nextval(''updid''), 8)) as
> v_updid;
Did you mean:
select into v_updid ''UPD'' || int2hex(nextval(''updid''), 8);
?
Tomasz
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
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, jasiek@klaster.net
Subject: Re: Pl Pgsql problem
In-Reply-To: <001901c30d6e$f4849880$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