X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7EFDF3A4F25 for ; Sat, 22 Jan 2005 19:03:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 82147-09 for ; Sat, 22 Jan 2005 19:03:42 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 1154A3A4ED0 for ; Sat, 22 Jan 2005 19:03:42 +0000 (GMT) Received: (qmail 21089 invoked from network); 22 Jan 2005 19:03:04 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 22 Jan 2005 19:03:04 -0000 Message-ID: <41F2A3FB.4000206@fastcrypt.com> Date: Sat, 22 Jan 2005 14:05:31 -0500 From: Dave Cramer Reply-To: pg@fastcrypt.com Organization: Postgres International User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nico Cc: pgsql-jdbc@postgresql.org Subject: Re: Relation "autonummeringl2" does not exist References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.131 tagged_above=0 required=5 tests=AWL, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200501/215 X-Sequence-Number: 12095 You should avoid upper case column names, 'autonumberingL2' is different than "autonumberingL2" note the double quotes vs single quotes. Dave Nico wrote: >Hello, >as I have told, I am making a servlet that generates a menu and one that >changes it(deleting, adding & updating items). However it returns an error: >Relation "autonummeringl2" does not exist >autonummeringL2 is the name of a sequence that raises a field by 1 each time >it is called. Any suggestions are welcome. > >Nico. > >Here is the table creation sql: > CREATE TABLE "tblMenuL2" ( > "MenuL2ID" integer DEFAULT nextval('autonummeringL2'::text) NOT NULL, > "MenuL1ID" integer NOT NULL, > "MenuL2Name" character varying(50) NOT NULL, > "MenuL2Page" character varying(50), > "MenuL2Order" smallint NOT NULL >); >ALTER TABLE ONLY "tblMenuL2" > ADD CONSTRAINT "pkMenuL2ID" PRIMARY KEY ("MenuL2ID"); >ALTER TABLE ONLY "tblMenuL2" > ADD CONSTRAINT "fkMenuL1ID" FOREIGN KEY ("MenuL1ID") REFERENCES >"tblMenuL1"("MenuL1ID") ON UPDATE CASCADE ON DELETE CASCADE; >ALTER TABLE ONLY "tblMenuL2" > ADD CONSTRAINT "MenuL2Volgorde" UNIQUE ("MenuL2ID", "MenuL1ID"); > >Here is the update query & insert. It happens during the insert query.: >UPDATE "tblMenuL2" SET "MenuL2Order"="MenuL2Order"+1 WHERE "MenuL2Order">=5; >INSERT INTO "tblMenuL2"("MenuL1ID", "MenuL2Name", "MenuL2Page", >"MenuL2Order") VALUES(1, 'naam', 'pagina', 5); > > > >---------------------------(end of broadcast)--------------------------- >TIP 4: Don't 'kill -9' the postmaster > > > > -- Dave Cramer http://www.postgresintl.com 519 939 0336 ICQ#14675561