Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.sql.SQLException: ORA-00904: invalid column name

843854Sep 20 2004 — edited Sep 20 2004
Hello,

I am getting the following error when accessing a database table:

java.sql.SQLException: ORA-00904: invalid column name

Here is the SQL:
String sqlStatus = "";
if (doc_status_cd.equals("A")) {
sqlStatus = " and d.doc_status_cd='A'";
}
String projectSql = "SELECT d.DOC_NO,d.PROJECT_NO,d.DOC_STATUS_CD,d.NAME,d.URL,d.DT_MODIFIED,d.MODIFIED_BY "
+" FROM CA_MASTER_PLAN.CA_DOC d, CA_MASTER_PLAN.CA_DOC_FUNCTION df "
+" where d.doc_function_cd = df.doc_function_cd"
+" and d.project_no='"+project_no+"' "
+ sqlStatus
+" order by df.seq_order, d.seq_no";

ResultSet resultSet = statement.executeQuery(projectSql);

The SQL runs fine in a SQL+ environemnt which means that the column names are valid.

Any ideas what is going on?

Thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 18 2004
Added on Sep 20 2004
7 comments
104 views