Creating Foreign Key

M

MD

Hey, I want to set one of my columns as a foreign key with no index when I
create it in my CREATE TABLE statement. However, I keep getting errors and
can not figure out where I am supposed to put the NO INDEX in my statement.

Basically, I have CREATE TABLE tablename(field1 STRING CONSTRAINT
PK_tablename PRIMARY KEY, field2 STRING CONSTRAINT FK_tablename_field2
REFERENCES foreigntable (foreignfield) ON UPDATE CASCADE ON DELETE CASCADE,
field3 STRING) . This works fine, but I do not want field2 indexed, which
this does.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top