Home » SQL & PL/SQL » SQL & PL/SQL » Unable to inser data -ORA-00917 (10GR/2)
Unable to inser data -ORA-00917 [message #341234] Sun, 17 August 2008 23:18 Go to next message
TJPokala
Messages: 17
Registered: March 2008
Junior Member
can't insert thsi data ..why???

These syntax comes form Oracle 7 and I am running it in Oracle 10G.


insert into sitesvalues ( 1, 'TESA','WEMN','WEMEN',to_date('03-JUN-00','DD-MON-YY');


Error:Missing comma ORA-00917

But i can do this:


select 1, 'TESA', 'WEMN', 'WEMEN',to_date('03-JUN-00','DD-MON-YY')from dual
;


And when I do this


insert into sites values ( 1, 'TESA','WEMN','WEMEN',sysdate);


Something to do with conversions?
Re: Unable to inser data -ORA-00917 [message #341238 is a reply to message #341234] Sun, 17 August 2008 23:26 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>insert into sitesvalues ( 1, 'TESA','WEMN','WEMEN',to_date('03-JUN-00','DD-MON-YY');

In which century is year '00'?
Does it work better if you use 'YYYY' & 4 digit year?
Re: Unable to inser data -ORA-00917 [message #341240 is a reply to message #341238] Sun, 17 August 2008 23:30 Go to previous messageGo to next message
TJPokala
Messages: 17
Registered: March 2008
Junior Member
Its 2000....


And I did try this as well..>Same error
insert into sites values ( 2, 'TESA', 'WEND',
'WENDOUREE',
to_date('03-JUN-2000','DD-MON-YYYY');

is it because thsi syntax comes from oracle 7 and I am running it in 10G ...Do i need to alter some NLS_DATE_FORMAT in 10G?
Re: Unable to inser data -ORA-00917 [message #341242 is a reply to message #341234] Sun, 17 August 2008 23:35 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>is it because thsi syntax comes from oracle 7 and I am running it in 10G ...Do i need to alter some NLS_DATE_FORMAT in 10G?

I don't think so, but I too can make mistakes.

http://www.orafaq.com/forum/t/88153/0/
Please read & FOLLOW the Posting Guidelines as stated in URL above

Re: Unable to inser data -ORA-00917 [message #341243 is a reply to message #341240] Sun, 17 August 2008 23:35 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Count your parenthesis.

Regards
Michel
Re: Unable to inser data -ORA-00917 [message #341244 is a reply to message #341234] Sun, 17 August 2008 23:37 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Michel,
Once again, Good Catch!
It is almost my bed time.

Later!
Re: Unable to inser data -ORA-00917 [message #341249 is a reply to message #341234] Sun, 17 August 2008 23:51 Go to previous messageGo to next message
TJPokala
Messages: 17
Registered: March 2008
Junior Member
Sad So silly!!!
Re: Unable to inser data -ORA-00917 [message #341268 is a reply to message #341234] Mon, 18 August 2008 02:03 Go to previous messageGo to next message
sumanthd
Messages: 10
Registered: June 2008
Location: Hyderabad
Junior Member

hi
here the problem is u have opened two braces that is one for the values and another for the to_date function but u have closed only one so u close both the braces then the problem is solved

insert into sitesvalues ( 1, 'TESA','WEMN','WEMEN',to_date('03-JUN-00','DD-MON-YY'));


bye
urs
sumanth
Re: Unable to inser data -ORA-00917 [message #341271 is a reply to message #341268] Mon, 18 August 2008 02:08 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide and don't use IM speak.

Regards
Michel
Previous Topic: Fiscal Year SQL query
Next Topic: ORA 24381
Goto Forum:
  


Current Time: Wed Dec 04 18:15:36 CST 2024