Jump to content

SQL Syntax Error


nathaliamota

Recommended Posts

I have the following table in a mysql database:

 

CREATE TABLE IF NOT EXISTS `CASE` (

  `CASE_NUM` bigint(20) unsigned NOT NULL auto_increment,

  `DATE` timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,

  `PERSON_ID` int(11) NOT NULL,

  `RESIDENCY_DETAILS_ID` int(11) NOT NULL,

  `MORT_COMP_ID` int(11) NOT NULL,

  `LOAN_ID` int(11) NOT NULL,

  `INTAKE_REPRE_ID` int(11) default NULL,

  `COUNSELOR_ID` int(11) default NULL,

  PRIMARY KEY  (`CASE_NUM`),

  UNIQUE KEY `PERSON_ID` (`PERSON_ID`),

  UNIQUE KEY `RESIDENCY_DETAILS_ID` (`RESIDENCY_DETAILS_ID`),

  UNIQUE KEY `LOAN_ID` (`LOAN_ID`),

  KEY `INTAKE_REPRE_ID` (`INTAKE_REPRE_ID`),

  KEY `COUNSELOR_ID` (`COUNSELOR_ID`),

  KEY `MORT_COMP_ID` (`MORT_COMP_ID`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

And I am trying to insert data to it. I have tried all of the following pieces of SQL code:

 

insert into CASE (PERSON_ID, RESIDENCY_DETAILS_ID, MORT_COMP_ID, LOAN_ID, INTAKE_REPRE_ID, COUNSELOR_ID) values (1, 2, 3, 4, 5, 6);

 

insert into CASE (PERSON_ID, RESIDENCY_DETAILS_ID, MORT_COMP_ID, LOAN_ID) values (1, 2, 3, 4);

 

insert into CASE (DATE, PERSON_ID, RESIDENCY_DETAILS_ID, MORT_COMP_ID, LOAN_ID, INTAKE_REPRE_ID, COUNSELOR_ID) values ("2003-12-31 01:02:03", 1, 2, 3, 4, 5, 6);

 

None of them work! They all generate a syntax error. Can anyone help me figure out what is wrong with it?

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/135234-sql-syntax-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.