posted 23 years ago
Hello all,
Iam trying to call a stored proc. in Oracle from my program when I get the following error message:
------------------------------------------------
java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification
ORA-06512: at "DBS1.INS_EXPENSE", line 20
ORA-06512: at line 1
------------------------------------------------
This my code snippet for calling the proc.
------------------------------------------------
CallableStatement statement= connection.prepareCall("{CALL INS_EXPENSE(?,?,?,?,?,?,?,?,?,?,?,?,?)}");
statement.setString(1, expenseType);
statement.setString(2, partyPayedTo);
statement.setBigDecimal(3, expenseAmount);
statement.setDate(4, billDate); //java.sql.Date
statement.setDate(5, bookedDate); // java.sql.Date
statement.setString(6, payedFromAcc);
statement.setString(7, payedToAcc);
statement.setString(8, paymentMode);
statement.setString(9, status);
statement.setString(10, comment);
statement.setString(11, entryUserid);
statement.setString(12, lastChangeUserid);
statement.registerOutParameter(13,java.sql.Types.NUMERIC);
statement.execute();
BigDecimal expno = statement.getBigDecimal(13);
--------------------------------------------------
ANd this is my procedure
-------------------------------------------------
CREATE OR REPLACE PROCEDURE "DBS1"."INS_EXPENSE"
( expense_type in VARCHAR2
, party_payed_to in VARCHAR2
, expense_amount in NUMBER
, bill_date in DATE
, booked_date in DATE
, payed_from_acc in VARCHAR2
, payed_to_acc in VARCHAR2
, payment_mode in VARCHAR2
, status in VARCHAR2
, comment in VARCHAR2
, entry_userid in VARCHAR2
, last_chg_userid in VARCHAR2
, expense_no out NUMBER
)
IS
BEGIN
select max(EXPENSE_NO) into expense_no from DBS1.EXPENSE;
expense_no := expense_no + 1;
insert into DBS1.EXPENSE (EXPENSE_NO,EXPENSE_TYPE,PARTY_PAYED_TO
,EXPENSE_AMOUNT,BILL_DATE,BOOKED_DATE,PAYED_FROM_ACC,PAYED_TO_ACC
,PAYMENT_MODE,STATUS,COMMENT,ENTRY_TIMESTAMP,ENTRY_USERID
,LAST_CHANGE_TIMESTAMP,LAST_CHANGE_USERID) VALUES
(expense_no,expense_type,party_payed_to,expense_amount,TO_DATE(bill_date,'yyyy-mm-dd')
,TO_DATE(booked_date,'yyyy-mm-dd'),payed_from_acc,payed_to_acc,payment_mode,status
,comment,SYSDATE,entry_userid,SYSDATE,last_chg_userid);
END INS_EXPENSE;
--------------------------------------------------
Line no. 20 points to the insert inside the stored proc. but i can't figure out whats wrong??
Any help would be appreciated.
TIA