create table problems

Thread Solved

Join Date: Apr 2009
Posts: 56
Reputation: baki100 is an unknown quantity at this point 
Solved Threads: 11
baki100 baki100 is offline Offline
Junior Poster in Training

create table problems

 
0
  #1
Oct 3rd, 2009
can someone help me identify the syntax error with this code
  1. CREATE TABLE IF NOT EXISTS Persons
  2. ( id_number VARCHAR(13) NOT NULL
  3. , name VARCHAR(45) NOT NULL
  4. , name_2 VARCHAR(45) NULL
  5. , name_3 VARCHAR(45) NULL
  6. , surname VARCHAR(45) NOT NULL
  7. , date_created DATE
  8. , date_modified DATE
  9. , PRIMARY KEY (id_number)
  10. , INDEX per_id_fk (id_number ASC)
  11. , INDEX per_stat_fk (id_number ASC)
  12. , CONSTRAINT per_id_fk FOREIGN KEY (id_number ) REFERENCES Person_Image (id_number ) ON DELETE CASCADE ON UPDATE CASCADE
  13. , CONSTRAINT per_stat_fk FOREIGN KEY (id_number ) REFERENCES Current_Status (id_number ) ON DELETE CASCADE ON UPDATE CASCADE
  14. )
Last edited by cscgal; Oct 3rd, 2009 at 4:50 pm. Reason: Fixed code tags
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 56
Reputation: baki100 is an unknown quantity at this point 
Solved Threads: 11
baki100 baki100 is offline Offline
Junior Poster in Training

Re: create table problems

 
1
  #2
Oct 3rd, 2009
no worries i found the error, i referenced foreign keys to tables that didn't exist yet
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 343 | Replies: 1
Thread Tools Search this Thread



Tag cloud for MySQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC