Home » SQL & PL/SQL » SQL & PL/SQL » adding constraints
adding constraints [message #290739] Mon, 31 December 2007 05:55 Go to next message
varu123
Messages: 754
Registered: October 2007
Senior Member

SQL>alter table ddo_mast add constraint pk1 primary key(trea_code,ddo_code);

after that when i try to issue:
SQL>alter table claim add constraint foreign key(trea_code,ddo_code)
references ddo_mast(trea_code,ddo_code);

error at line 1:
invalid datatype

i have checked the data types.its varchar2(4) for all the four columns.
Re: adding constraints [message #290741 is a reply to message #290739] Mon, 31 December 2007 06:05 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member

does this work.

alter table claim add constraint fk1 foreign key (trea_code,ddo_code)
references ddo_mast(trea_code,ddo_code);


constraint name is missing.

[edit:correctd the syntax error]

regards

[Updated on: Mon, 31 December 2007 06:08]

Report message to a moderator

Re: adding constraints [message #290743 is a reply to message #290739] Mon, 31 December 2007 06:16 Go to previous message
varu123
Messages: 754
Registered: October 2007
Senior Member
AAh, i hate myself Mad

Thanks anyways
Previous Topic: Describing Record Type created in Package Specification
Next Topic: Display nth row from a table
Goto Forum:
  


Current Time: Sat Dec 03 03:48:47 CST 2016

Total time taken to generate the page: 0.12091 seconds