2

select salution||' '||firstname||' '||lastname as custName , city as custCity ,state as custState,zip as custZip, dob as custDob ,idhardtoken as custAdarNo from mstuser ;

For the above query I am getting the oracle error ORA-00911: invalid character error while executing a query from java class file. What will be the correction for it ?

Alex Poole
  • 183,384
  • 11
  • 179
  • 318
Shuvajit Ghosh
  • 108
  • 2
  • 17

1 Answers1

2

An SQL statement does not include a trailing semicolon. That is used as a statement separator in SQL*Plus and other clients (though even there you can change that to a different character), and it is not part of the statement itself. (PL/SQL requires semicolons as separators, but that's off-topic).

When you're running the statement over JDBC you should not include the semicolon. You should just be running

"select salution||' '||firstname||' '||lastname as custName, "
    + "city as custCity, state as custState, zip as custZip, "
    + "dob as custDob, idhardtoken as custAdarNo from mstuser"

(split just to show it without sideways scrolling...)

Alex Poole
  • 183,384
  • 11
  • 179
  • 318