|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hi all,
I had encountered a problem when trying to create this table in Oracle 8i. Need professional views on this. Many thanks! ![]() EXECUTE DBMS_OUTPUT.PUT_LINE('Creating Customer Table') EXECUTE DBMS_OUTPUT.PUT_LINE('=======================') CREATE SEQUENCE customer_id_seq INCREMENT BY 1 START WITH 00000001 MAXVALUE 99999999 NOCACHE NOCYCLE; CREATE TABLE customer (customer_id NUMBER(8) NOT NULL PRIMARY KEY, customer_name CHAR(30) NOT NULL, customer_NRIC CHAR(10) NOT NULL UNIQUE, customer_address VARCHAR2(50) NOT NULL, customer_email CHAR(30) NOT NULL, customer_contact NUMBER(8) NOT NULL, order_id NUMBER(8) NOT NULL, CONSTRAINT customer_customer_id CHECK (customer_id between 00000001 and 99999999), CONSTRAINT customer_order_id_fk FOREIGN KEY(order_id) references orders(order_id)on delete cascade)); The error is at the last line. It says - ERROR at line 10: ORA-00922: missing or invalid option I can create the table without the foreign key constraint. ![]() |
|
#2
|
||||
|
||||
|
CONSTRAINT customer_order_id_fk FOREIGN KEY(order_id) references orders(order_id)on delete cascade));
Should there be a space inbetween orders(order_id) and on |
|
#3
|
|||
|
|||
|
I added the space but it still doesn't work.
HELP!!!Quote:
|
|
#4
|
||||
|
||||
|
is your table orders already created?
and do the field types match? try posting your updated code... a i suggest putting [ code ] tags (without the spaces) around it to preserve any indenting [it'll be easier for us to read]. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > ORA-00922: missing or invalid option |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|