Home » SQL & PL/SQL » SQL & PL/SQL » ORA-00911 when trying to insert user name and sysdate
ORA-00911 when trying to insert user name and sysdate [message #192246] Mon, 11 September 2006 09:37 Go to next message
natasha2006
Messages: 2
Registered: September 2006
Junior Member
I have the following query :

INSERT INTO MYTABLE values ('8',0.06, user , sysdate, sysdate, user);

which works in Oracle SQL Plus query window.

But when I do this from the C++ code, I am getting an error: ORA_00911 - invalid character.

What is wrong?

Thanks!

P.S. When I changed the query to be INSERT INTO MYTABLE values ('8',0.06, :user , sysdate, sysdate, :user);

I am not getting any errors, but nothing is getting inserted.
Re: ORA-00911 when trying to insert user name and sysdate [message #192262 is a reply to message #192246] Mon, 11 September 2006 10:33 Go to previous messageGo to next message
markmal
Messages: 113
Registered: April 2006
Location: Toronto, Canada
Senior Member
natasha2006 wrote on Mon, 11 September 2006 10:37

I have the following query :

INSERT INTO MYTABLE values ('8',0.06, user , sysdate, sysdate, user);

which works in Oracle SQL Plus query window.

But when I do this from the C++ code, I am getting an error: ORA_00911 - invalid character.

What is wrong?



Please quote your piece of C++ code here.

natasha2006 wrote on Mon, 11 September 2006 10:37


P.S. When I changed the query to be INSERT INTO MYTABLE values ('8',0.06, :user , sysdate, sysdate, :user);

I am not getting any errors, but nothing is getting inserted.


Weird. Are you sure that there is no exception?
Do you COMMIT after?
Re: ORA-00911 when trying to insert user name and sysdate [message #192264 is a reply to message #192262] Mon, 11 September 2006 10:54 Go to previous message
natasha2006
Messages: 2
Registered: September 2006
Junior Member
Thanks a lot, I have resolved this. It was a semicolon at the end, which I removed and the query ran fine.
Previous Topic: Running dbms_stats is taking very long time
Next Topic: Autofit is not working while transfering data to excel from 10gdatabase
Goto Forum:
  


Current Time: Wed Dec 07 04:59:04 CST 2016

Total time taken to generate the page: 0.05194 seconds