3

I am executing a simple database query in Eclipse:

statement.executeUpdate(
    "INSERT INTO DBUSER(USER_ID,USERNAME,CREATED_BY,CREATED_DATE) 
    VALUES (3,'KUMAR','ERPDIRECT',to_date('29/08/2011', 'dd/mm/yyyy'));"
);

But am getting:

ORA-00911: invalid character error

But When am executing this query in sql*plus command line it was executing without fail.

phant0m
  • 16,595
  • 5
  • 50
  • 82
nikks
  • 33
  • 2

1 Answers1

6

Try removing the trailing semi-colon from the SQL string. It's not necessary when executing via JDBC, and may in fact be an error.

skaffman
  • 398,947
  • 96
  • 818
  • 769