This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Error java.sql.SQLException: ORA-00923 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Error java.sql.SQLException: ORA-00923" Watch "Error java.sql.SQLException: ORA-00923" New topic

Error java.sql.SQLException: ORA-00923

Ayeda AngeL

Joined: Jan 18, 2004
Posts: 7
Hi All,
Well i have this error which i dont know how to solve. I dont get any error in my code, but when compiling my JSP code i get the following error
java.sql.SQLException: ORA-00923: FROM keyword not found where expected
Can anyone explain what does it means? and the way to solve it??
Craig Jackson
Ranch Hand

Joined: Mar 19, 2002
Posts: 405
Well this is not a jsp/servlet type issue. I am assuming you are trying to get data from an Oracle database.
java.sql.SQLException: ORA-00923: FROM keyword not found where expected
Can anyone explain what does it means? and the way to solve it??

Well, without seeing the actual SQL code, I will guess that your SQL SELECT statement is missing the FROM keyword. And the way to solve it is to break out the old SQL syntax manual. If you don't have one there are alot of free beginner tutorials on the internet.
I hope this helps.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63202

Moving to the JDBC forum.
As cj pointed out, I'm not sure anyone is going to be able to help you without the SQL statement that's causing the problem.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jason Cox
Ranch Hand

Joined: Jan 21, 2004
Posts: 287
Check your actual SQL statement and make sure there is a space between the 'FROM' declaration and whatever the query is before it. Make sure you also do not have a comma before it.
Examples -
SELECT column_name FROM table_name WHERE column_name = ? // CORRECT!!!
SELECT column_nameFROM table_name WHERE column_name = ? // BAD!!!
SELECT column_name, FROM table_name WHERE column_name = ? // BAD!!!
This is especially important if you are using a StringBuffer or String concantonation(sp?) to build the SQL statement. It's fairly typical to be off on the spacing or inserting a trailing comma before 'FROM' is declared. Also, you need to use it in the same place as I specified.
Great tutorial on SQL can be found at -
[ January 27, 2004: Message edited by: Rob Aught ]
It is sorta covered in the JavaRanch Style Guide.
subject: Error java.sql.SQLException: ORA-00923
It's not a secret anymore!