Unix Technical Forum

Relation "autonummeringl2" does not exist

This is a discussion on Relation "autonummeringl2" does not exist within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> Hello, as I have told, I am making a servlet that generates a menu and one that changes it(deleting, ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 11:00 PM
Nico
 
Posts: n/a
Default Relation "autonummeringl2" does not exist

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);


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-15-2008, 11:00 PM
Dave Cramer
 
Posts: n/a
Default Re: Relation "autonummeringl2" does not exist

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


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-15-2008, 11:00 PM
Nico
 
Posts: n/a
Default Re: Relation "autonummeringl2" does not exist

I changed the name of sequences in the database. It works fine now.
Thanks.

"Dave Cramer" <pg@fastcrypt.com> schreef in bericht
news:41F2A3FB.4000206@fastcrypt.com...
> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:38 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com