Received: from ctron-dnm.ctron.com (ctron-dnm.enterasys.com [12.25.1.120]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1BDjaE37574 for ; Mon, 11 Feb 2002 08:45:36 -0500 (EST) (envelope-from rhunter@enterasys.com) Received: (from uucp@localhost) by ctron-dnm.ctron.com (8.8.7/8.8.7) id IAA13943 for ; Mon, 11 Feb 2002 08:55:05 -0500 (EST) Received: from unknown(134.141.77.96) by ctron-dnm.ctron.com via smap (4.1) id xma013929; Mon, 11 Feb 02 08:54:12 -0500 Received: by cnc-exc1.enterasys.com with Internet Mail Service (5.5.2653.19) id <1VYXNGSZ>; Mon, 11 Feb 2002 08:43:47 -0500 Message-ID: <59358A738F45D51186A30008C74CE250E81373@slc-exc1.ctron.com> From: "Hunter, Ray" To: pgsql-sql@postgresql.org Subject: Sequences Date: Mon, 11 Feb 2002 08:43:23 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C1B302.130648D0" X-Archive-Number: 200202/105 X-Sequence-Number: 6533 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C1B302.130648D0 Content-Type: text/plain I have various sequences in my database set up for ids. My question is: How can I get the current value of the sequence without creating a session and using the currval function? I would like to take the current value of the sequence and use it for a value in an insert statement. Example: insert into users ( "user_id", "user_fname", "user_lname", "user_email" ) values ( 'current sequence', 'Ray', 'Hunter', 'rhunter@enterasys.com' ); Thanks, Ray Hunter Firmware Engineer ENTERASYS NETWORKS Phone: 801 887-9888 Fax: 801 972-5789 Email: rhunter@enterasys.com www: www.enterasys.com ------_=_NextPart_001_01C1B302.130648D0 Content-Type: text/html Content-Transfer-Encoding: quoted-printable Sequences

I have various sequenc= es in my database set up for ids.  My question is:  How can I get= the current value of the sequence without creating a session and using the= currval function?

I would like to take t= he current value of the sequence and use it for a value in an insert statem= ent.


Example:

        insert into users ( "user_id", "user_f= name", "user_lname", "user_email" )
        values ( 'current sequence', 'Ray', 'Hunter', 'rhunte= r@enterasys.com' );

Thanks,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS

Phone:      &nb= sp;   801 887-9888
Fax:      &nbs= p;     801 972-5789
Email:      &n= bsp;   rhunter@enterasys.com=
www:      &nbs= p;     <= FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Verdana">www.enterasys.com

------_=_NextPart_001_01C1B302.130648D0--