Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0IJXa094771 for ; Thu, 18 Jan 2001 14:33:37 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [208.59.253.44] (HELO agliodbs.com) by davinci.ethosmedia.com (CommuniGate Pro SMTP 3.3) with ESMTP id 1178871; Thu, 18 Jan 2001 11:33:34 -0800 Message-ID: <3A674436.E021A37F@agliodbs.com> Date: Thu, 18 Jan 2001 11:29:58 -0800 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions X-Mailer: Mozilla 4.73 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: clayton cottingham CC: Najm Hashmi , "pgsql-sql@postgresql.org" Subject: Re: Selecting Current value from a sequence References: <3A688085.23E57E79@mondo-live.com> <3A6737F7.A21FECA0@smartt.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200101/223 X-Sequence-Number: 890 Clayton, > > Hi all, > > It is a very simple but I am not able to recall how to do it.... I > > just need to find out the current value of a seq. It is very simple > > select statement but I can't recall it... Help me please before I get > > myself get fired -:). > > Regards, Najm > > select nextval('nameofseq'); Sorry, no. You want SELECT CURRVAL('sequence_name'). NEXTVAL select the NEXT value, and increments the sequence in the process. -Josh Berkus -- ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 436-9166 for law firms, small businesses fax 436-0137 and non-profit organizations. pager 338-4078 San Francisco