Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to keep Referential Integerity without using %TYPE?

Status
Not open for further replies.

Petemush

Technical User
Jun 21, 2002
255
GB
Hellooo!

I'm trying to create a table in a piece of sql and wanted to make sure that the table's one column is definitely the same as a column in another table that is already created.

For this end I thought I could use the following syntax:

CREATE TABLE temp_asns(asn_asn_id asns.asn_id%TYPE)

Except this doesn't work. I assume this is because I'm getting confused and the %TYPE syntax is actually PL/SQL so I can't use it.

If this is the case, is there any other way of basing the column's datatype on a column in another table? I thought of maybe using the AS syntax on CREATE TABLE but I still need to define columns so that doesn't look hopeful!

Any ideas?

Cheers,

Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top