MySQL Forums
Forum List  »  Newbie

Re: Can anyone help me
Posted by: Kelly Penhall-Wilson
Date: May 03, 2005 10:09AM

That's correct - I suppose I wasn't clear, you have to put *something* in the placeholder such as an empty string '', or NULL, putting nothing without either of those two will produce an error.

CREATE TABLE `tab3` (
`pkey` int(11) NOT NULL auto_increment,
`col1` varchar(50) default NULL,
`col2` varchar(50) default NULL,
PRIMARY KEY (`pkey`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

insert into tab3 values(,'somevalue','someothervalue')

produces this error:

Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''somevalue','someothervalue')' at line 1
(0 ms taken)

while this
insert into tab3 values('','somevalue','someothervalue')

works-

Options: ReplyQuote


Subject
Written By
Posted
May 02, 2005 03:55PM
May 02, 2005 09:53PM
Re: Can anyone help me
May 03, 2005 10:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.