Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 2FCB79FB843 for ; Tue, 3 Apr 2007 07:29:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 89383-10 for ; Tue, 3 Apr 2007 07:29:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from smtpout26.attiva.biz (smtpout26.attiva.biz [85.37.16.27]) by postgresql.org (Postfix) with ESMTP id 553839FB84F for ; Tue, 3 Apr 2007 07:29:20 -0300 (ADT) Received: from FBCMFE02B07.fbc.local ([192.168.30.95]) by smtpout26.attiva.biz with Microsoft SMTPSVC(6.0.3790.1830); Tue, 3 Apr 2007 12:29:16 +0200 Received: from dream ([88.34.161.130]) by FBCMFE02B07.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Tue, 3 Apr 2007 12:29:15 +0200 Message-ID: <00e101c775da$fce4ec90$1102a8c0@dream> Reply-To: "Shavonne Marietta Wijesinghe" From: "Shavonne Marietta Wijesinghe" To: References: <008301c775d1$4b224420$1102a8c0@dream> <20070403093222.GB30108@a-kretschmer.de> <00b101c775d6$2d313840$1102a8c0@dream> <20070403101446.GC30108@a-kretschmer.de> Subject: Re: Serial Date: Tue, 3 Apr 2007 12:29:37 +0200 Organization: Studio FORM MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-OriginalArrivalTime: 03 Apr 2007 10:29:15.0985 (UTC) FILETIME=[EE031C10:01C775DA] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/23 X-Sequence-Number: 28023 I'm mixed up now. I was suppose to something but i did something else. OK so i have my FAMOUS table with the n_gen serial NOT NULL I got lost a bit. When and where do i use the setval() ?? For example i INSERT records via ASP. so i should put the setval() in the INSERT INTO of the ASP page?? And even when i do a SELECT i should use the setval()?? SELECT setval(N_GEN) FROM MyTable ORDER BY N_GEN::INT DESC ?? Shavonne Wijesinghe