oracle10gora-00911

Oracle 10g : insert statement with date and varchar2 values (ORA-00911 error)


I have created a table in Oracle 10g and trying to insert some rows into the table using insert statements. But I am repeatedly getting the following error:

ORA-00911: invalid character

And the insert statements that are giving the ORA-00911 error is as follows:

Insert into WinLossByDate (StatusDate, Status)
        Values (TO_DATE(‘2011-03-01’,‘yyyy-mm-dd’), ‘lose’);

N.B.My table definition is as follows

 Name                                      Null?    Type
 ----------------------------------------- -------- -------------

 STATUSDATE                                NOT NULL DATE
 STATUS                                    NOT NULL VARCHAR2(5)

Can somebody help what is the error?


Solution

  • According to the manual this appears to be a lexer error (e.g. oracle is having trouble breaking your statement down into tokens so it can parse it).

    I've noticed that the quotes in your example are the pretty looking ones that have a left and right hand side (i.e. and instead of ' -- look closely to see the difference). Some word processors do this to make the text look nicer. Try manually retyping the quotes part of a statement into a plain text editor such as notepad or VIM.