Skip to Main Content

SQL & PL/SQL

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!

Help - error : ORA-00984: Column not allowed here

720017Aug 30 2009 — edited Aug 31 2009
Hi,

I'm writing a simple Java program to update values into Oracle tables. But getting error - 'ORA-00984: Column not allowed here' in the line - sql2.executeUpdate(acctTabSql);

There is no column name used in 'insert statement - and referred suggestion here to resolve the error, but couldn't. Please write me how to resolve it. ?

Here is the code snippet below.

Thanks, Vasu

------------------------
T_ACCT

ACCT_ID (PK) GEN INTEGER
ALS_NBR:STRING
STATUS_CD:STRING
NOTE_DT:DATE
-----------------


int intVal1 = 0;
int intVal2 = 0;

Statement sql1 = oraConnection.createStatement();
ResultSet rs = sql1.executeQuery("SELECT ACCT_ID_SEQ.NEXTVAL, APPL_ID_SEQ.NEXTVAL FROM DUAL");
while(rs.next()){
intVal1 = rs.getInt(1);
intVal2 = rs.getInt(2);
System.out.println("ACCT_ID :" + intVal1);
System.out.println("APPL_ID :" + intVal2);
}
sql1.close();


Statement sql2 = oraConnection.createStatement();
String acctTabSql = "INSERT INTO VPDBO.T_ACCT (ACCT_ID, ALS_NBR, NOTE_DT, HELMS_NBR, SL_REF_NBR, BK_MSG_RECEIVED_DT) " +
"VALUES (intVal1,'' ,'' ,'' ,'' ,'' )";
System.out.println(acctTabSql);
-/Error/- sql2.executeUpdate(acctTabSql);
sql2.close();

Statement sql3 = oraConnection.createStatement();
String applTabSql = "INSERT INTO T_APPL (APPL_ID, ACAPS_ID, STATUS_CD, ACAPS_PROD_CD, ACCT_ID, DCAPP_MSG_RECEIVED_DT) " +
"VALUES (intVal1, valappIdValue, 'EN', '', intVal2, '08/26/09')";
System.out.println(applTabSql);
sql3.executeUpdate(applTabSql);
sql3.close();

oraConnection.commit();
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2009
Added on Aug 30 2009
1 comment
660 views