Home » SQL & PL/SQL » SQL & PL/SQL » Can't get this insert right? (Oracle 10g express)
Can't get this insert right? [message #448929] Thu, 25 March 2010 19:12 Go to next message
vandorin
Messages: 1
Registered: March 2010
Junior Member
Hello, I'm trying to insert data into a table, but can't seem to get the actual code right, when I put it in, it tells me that there is a comma missing, can anyone help me? Here is the code I have that is giving me the error:
INSERT INTO Orders VALUES('00001', 'c001', 'ca01', '20.5', TO_DATE('12032009', 'DDMMYYYY');
Re: Can't get this insert right? [message #448930 is a reply to message #448929] Thu, 25 March 2010 19:31 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
vandorin wrote on Thu, 25 March 2010 17:12
Hello, I'm trying to insert data into a table, but can't seem to get the actual code right, when I put it in, it tells me that there is a comma missing, can anyone help me? Here is the code I have that is giving me the error:
INSERT INTO Orders VALUES('00001', 'c001', 'ca01', '20.5', TO_DATE('12032009', 'DDMMYYYY');


PROGRAMMING 101 basic tenant is quotes must occur in pairs & for every opening parenthesis a closing parenthesis must exist.
Re: Can't get this insert right? [message #448960 is a reply to message #448929] Fri, 26 March 2010 00:32 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
In addition to Blackswan answer, if you use SQL*PLus it will tell you the right message and point to the character where it fails.

Regards
Michel
Re: Can't get this insert right? [message #449057 is a reply to message #448929] Fri, 26 March 2010 08:10 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
And doing a blind insert without naming the columns is also poor programming.
Re: Can't get this insert right? [message #449184 is a reply to message #448929] Sat, 27 March 2010 11:37 Go to previous message
Kevin Meade
Messages: 2103
Registered: December 1999
Location: Connecticut USA
Senior Member
all good advice. Hope the OP has got an answer since we have no response yet.

As was alluded to by previous posters, your issue is not missing comma.

Kevin
Previous Topic: can function return multiple rows
Next Topic: Commit V/S Rollback
Goto Forum:
  


Current Time: Fri Feb 14 08:14:11 CST 2025