SQLite in Android - Syntax Error in CREATE TABLE -


i have been working on android app while , have started getting making database app. being said having issue create table commands. have run these through sql fiddle , doesn't seem think there problem, eclipse does.

create table team (_id integer primary key ,                     teamname text ,                     teamyear text ,                     teamlevel text )  create table matchs (_id integer primary key ,                       oponentname text ,                       matchdate text ,                       teamid integer not null  ,                       foreign key (teamid) references team (_id ))  create table matchset (_id integer primary key ,                         setnumber text ,                         matchid integer not null  ,                         foreign key (matchid) references matchs (_id ))  create table player (_id integer primary key ,                       playernumber text ,                       playerposition text ,                       playerfirstname text ,                       playerlastname text ,                       playernickname text ,                       playerpic text ,                       playertagline text ,                       teamid integer not null  ,                       foreign key (teamid) references team (_id ))  create table par (_id integer primary key ,                    action text ,                    result text ,                    playerid integer not null  ,                    foreign key (playerid) references player (_id ) ,                    setid integer not null  ,                    foreign key (setid) references matchset (_id ))  create table stats (_id integer primary key ,                      playerid integer not null  ,                      foreign key (playerid) references player (_id ) ,                      setid integer not null  ,                      foreign key (setid) references matchset (_id ) ,                      attackkill text ,                      attackerror text ,                      attacktotal text ,                      attackpercentage text ,                      setassist text ,                      serveace text ,                     serveerror text ,                      servezero text ,                      passrating text ,                      blocksolo text ,                      blockassist text ,                      blockerror text ,                      genbhe text ,                      pts text ) 

the error being thrown on creation of par table near setid foreign key. appreciated.

place foreign key constraints @ end of create table.

compare fiddle using sql above working demo.

the first 1 returned error:

could not prepare statement (1 near "setid": syntax error)


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -