Nooby Posted June 11, 2007 Share Posted June 11, 2007 Im new to sql in Oracle and i hope i have posted this in the correct forum. Im trying to create a new table but not having any luck and i would be greatful if somebody could point me in the right direction. create table global_locations(id number(6)CONSTRAINT id_global_locations_id NOT NULL, name VARCHAR2(25), date_opened date, address VARCHAR2(50), city VARHCAR2(25), zip/post_code VARCHAR2(10), phone VARCHAR2(20), email VARHCAR2(30), manager_id VARCHAR2(6), emergency_contact VARCHAR2(30), CONSTRAINT global_locations_id_uk UNIQUE(id,manager_id)); Error ORA-00907: missing right parenthesis I have checked and for the life of me can't see the problem. Thanx in advance for any help and again im sorry if this is in the wrong place or format. Quote Link to comment https://forums.phpfreaks.com/topic/55069-problem-creating-tables/ Share on other sites More sharing options...
Illusion Posted June 13, 2007 Share Posted June 13, 2007 try this create table global_locations (id number(6) , name VARCHAR2(25), date_opened date, address VARCHAR2(50), city VARHCAR2(25), zip/post_code VARCHAR2(10), phone VARCHAR2(20), email VARHCAR2(30), manager_id VARCHAR2(6), emergency_contact VARCHAR2(30),CONSTRAINT id_global_locations_id PRIMARY KEY(id),CONSTRAINT global_locations_id_uk UNIQUE(manager_id)); as you are trying to impose two constraints NOT NULL and UNIQUE on same column id which is same as using PRIMARY KEY so I combined it to one constraint. I think the mistake you have done is using column name as "zip/post_code" so change it using proper naming convention. Quote Link to comment https://forums.phpfreaks.com/topic/55069-problem-creating-tables/#findComment-273745 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.