MichaelD
MichaelD

Reputation: 107

composite primary key in webSQL

I'm trying to create a database in websql with a composite primary key, but i can't seem to figure out what is wrong with this statement:

tx.executeSql('CREATE TABLE IF NOT EXISTS groepleden(id_groep INTEGER, id_lid INTEGER, PRIMARY KEY(id_groep, id_lid)');

this is for an application written in jQuery Mobile, any help would be appreciated

Upvotes: 1

Views: 984

Answers (1)

Devon Bessemer
Devon Bessemer

Reputation: 35357

CREATE TABLE IF NOT EXISTS groepleden
(id_groep INTEGER, id_lid INTEGER, PRIMARY KEY(id_groep, id_lid))

Missing the last parenthesis. You only closed the primary key arguments, not the field list.

Upvotes: 2

Related Questions