Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored procedure error ora-00600 on oracle 8i!

Status
Not open for further replies.

Inandjo

Programmer
Dec 7, 2001
46
FR
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 dont know Java, but your procedure takes 2 numbers for parameters, but your Java initialisation seems to expect the first to be a varchar string.

Also, what is an OutParameter? The procedure takes 2 IN parameters (by default) but will not pass any values back in those parameters unless they are defined as OUT parameters.
 
Hi,
As a general rule all 600 errors should be reported to Oracle Support for resolution as they can indicate serious problems with Oracle's internals...The parameters will help them isolate which of the many possible reasons are involved with your particular instance.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I checked on Metalink. There are several direct hits on this. The following extract is the most helpful response I found:

This exception is signalled when the user interface cannot recognize the PL/SQL block and there are problems processing the underlying cursor information. There is no underlying data corruption as a result of this error.

Some suggestions:

Check the failing code and see if the problem can be reproduced in sqlplus.

Query the dba_objects view to ensure the PL/SQL block or procedure is VALID in the status column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top