SQLite Composite Key Create Fails

Put your problem here if it does not fit any of the other categories.

SQLite Composite Key Create Fails

Postby gilgantic » Fri Feb 29, 2008 5:05 am

In SQLite my composite key PK_SOME_LKUP fails to create when I ALTER the table. My table creates, but my composite key creation fails. Any idea what the syntax should be?

TABLE CREATE - PASS
create table SOME_TABLE(KEY_1 text not null, KEY_2 text not null )


COMPOSITE PRIMARY KEY - FAIL
alter table SOME_TABLE add constraint PK_SOME_LKUP primary key (KEY_1,KEY_2);


Thanks! :D
gilgantic
gilgantic
Freshman
Freshman
 
Posts: 6
Joined: Sun Feb 24, 2008 11:08 pm

Top

Postby cabernet1976 » Fri Feb 29, 2008 2:27 pm

Hi gilgantic,

why not to remove and re-create the table? :)
Upload2Flickr's blog: http://upload2flickr.blogspot.com
cabernet1976
Senior Developer
Senior Developer
 
Posts: 154
Joined: Fri Nov 16, 2007 2:34 am
Location: China

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 21 guests