I am getting the not all variables bound error message. Reserach on the internet states that this error is triggered by not supplying the right number of varaibles to the place holders.
But I have:
The store procedure is as follows:
CREATE OR REPLACE procedure INSERTINTOTIMESHEET(cName IN varchar2,
pName IN varchar2,
charge IN varchar2,
inv IN varchar2,
we IN DATE)
IS
BEGIN
DECLARE
tID NUMBER;
cID NUMBER;
pID NUMBER;
cursor tscursor IS select timeSheetId from TIMESHEET;
BEGIN
select CUSTOMERID into cID from CUSTOMER where CUSTOMERNAME=cName;
select PROJId into pID from PROJECT where PROJNAME=pName;
OPEN tscursor;
FETCH tscursor INTO tID;
dbms_output.put_line('SQL%ROWCOUNT '|| tscursor%ROWCOUNT);
IF tscursor%ROWCOUNT = 0 THEN
dbms_output.put_line('0 rows returned');
INSERT INTO TIMESHEET values (100,cID,pID,charge,0,inv,we);
ELSE
dbms_output.put_line('1 row returned');
select max(timeSheetId) into tID from TIMESHEET;
tID := tID+1;
INSERT INTO TIMESHEET values (tID,cID,pID,charge,0,inv,we);
END IF;
END;
END;
This procedure works by it self, fails when I call it from a
JSP:
String Customer = request.getParameter("Customer");
String Project = request.getParameter("Project");
String Chargeble = request.getParameter("Chargeble");
String Invoiced = request.getParameter("Invoiced");
String weekEnding = request.getParameter("Week Ending");
try
{
CallableStatement cstmt =
conn.prepareCall("{call INSERTINTOTIMESHEET(?,?,?,?,?)}");
cstmt.executeQuery();
cstmt.setString(1, Customer);
cstmt.setString(2, Project);
cstmt.setString(3, Chargeble);
cstmt.setString(4, Invoiced);
cstmt.setString(5, weekEnding);
}
catch(SQLException se)
{
System.out.println(se);
}
Thanks for any help Tony.