Hello,
I'm a newbie to oracle, and created the following stored procedure:
<quote>
create or replace procedure myproc4(dno number, perc number)
is
cursor emp_cur (dept_no number) is
select sal from emp where deptno=dept_no for update of sal;
empsal number(8);
begin
open emp_cur(dno);
loop
fetch emp_cur into empsal;
exit when emp_cur%NOTFOUND;
update emp set sal=empsal*(perc/100)
where current of emp_cur;
end loop;
close emp_cur;
commit;
end myproc4;
</quote>
In this emp table, sal is a number(4,2).
In my java code, here is how i call the SP:
<quote>
try {
CallableStatement cs = con.prepareCall("{ call myproc4(?,?)}");
cs.setString(1,deptno);
cs.setInt(2,percentage);
cs.registerOutParameter(1, Types.VARCHAR);
cs.registerOutParameter(2, Types.INTEGER);
ResultSet res =(ResultSet) cs.executeQuery();
cs.close();
res.close();
} catch (SQLException sqle){
...;
}
}
</quote>
Here is the error I get when running that code:
<quote>
ORA-00600: internal error code, arguments : [12259], [], [], [], [], [], [], []
</quote>
My sal column is not being updated in addition to this error message.
I googled this error, but didn't come across anything significantly helpfull.
I just don't see what's preventing the column from being updated, even after I changed the datatype of precentage to int, float or even double in my java code!
What can possibly be going wrong, and where am I missing something?
Thanx!
La faim justifie les moyens!
I'm a newbie to oracle, and created the following stored procedure:
<quote>
create or replace procedure myproc4(dno number, perc number)
is
cursor emp_cur (dept_no number) is
select sal from emp where deptno=dept_no for update of sal;
empsal number(8);
begin
open emp_cur(dno);
loop
fetch emp_cur into empsal;
exit when emp_cur%NOTFOUND;
update emp set sal=empsal*(perc/100)
where current of emp_cur;
end loop;
close emp_cur;
commit;
end myproc4;
</quote>
In this emp table, sal is a number(4,2).
In my java code, here is how i call the SP:
<quote>
try {
CallableStatement cs = con.prepareCall("{ call myproc4(?,?)}");
cs.setString(1,deptno);
cs.setInt(2,percentage);
cs.registerOutParameter(1, Types.VARCHAR);
cs.registerOutParameter(2, Types.INTEGER);
ResultSet res =(ResultSet) cs.executeQuery();
cs.close();
res.close();
} catch (SQLException sqle){
...;
}
}
</quote>
Here is the error I get when running that code:
<quote>
ORA-00600: internal error code, arguments : [12259], [], [], [], [], [], [], []
</quote>
My sal column is not being updated in addition to this error message.
I googled this error, but didn't come across anything significantly helpfull.
I just don't see what's preventing the column from being updated, even after I changed the datatype of precentage to int, float or even double in my java code!
What can possibly be going wrong, and where am I missing something?
Thanx!
La faim justifie les moyens!