java.sql.SQLException: ORA-00904: invalid column name
843854Sep 20 2004 — edited Sep 20 2004Hello,
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