ORA-6512 Error problem
Date: 20 Feb 2003 04:26:57 -0800
Message-ID: <1e562f83.0302200426.3cc44f84_at_posting.google.com>
Hi,
We are facing a strange kind of problem. We have a Pro*C function calling a stored procedure. This procedure, when no data is found, raises the NO_DATA_FOUND exception via the RAISE statement.
When the stored procedure call returns, in some cases the sqlca structure is as in Value 1 below and in some it is as in Value 2 below. (this is as observed by running gdb and printing the sqlca structure)
Value 1 = {sqlcaid = "\000\000\000\000\000\000\000", sqlabc = 0, sqlcode = 1403, sqlerrm = {sqlerrml = 70,
sqlerrmc = "ORA-01403: no data found\nORA-06512: at
\"NI09.ZCA_HELPER_PKG\", line 88\n"},
sqlerrp = "\000\000\000\000\000\000\000", sqlerrd = {0, 0, 0, 0, 0,
0}, sqlwarn = " ",
sqlext = "\000\000\000\000\000\000\000"}
Value 2 = {sqlcaid = "\000\000\000\000\000\000\000", sqlabc = 0, sqlcode = -6512, sqlerrm = {sqlerrml = 66,
sqlerrmc = "ORA-06512: at \"NI09.ZCA_HELPER_PKG\", line
88\nORA-06512: at line 1\n "},
sqlerrp = "\000\000\000\000\000\000\000", sqlerrd = {0, 0, 0, 0, 0,
0}, sqlwarn = " ",
sqlext = "\000\000\000\000\000\000\000"}
The line numbers in the package at which the exception occurs is the same, viz. the line where the NO_DATA_FOUND exception is raised. However, the sqlca.sqlcode gets set to 1403 (No data found) in some cases and to 6512 in some cases. Our Pro*C layer handles the 1043 error before further processing. However, since in some cases we get 6512, further processing is hampered.
As far as I understand ORA-6512 is just a generic error that gives details of the line number where the error occured for those exceptions that are not handled in the PL/SQL engine. However, this detail would always be a part of the sqlca.sqlerrm structure and the sqlca.sqlcode would always be set to the actual error code that was not handled (and never 6512). I'm not sure if this is correct. Please do correct me if I'm wrong.
For e.g., In Value 1 above, sqlca.sqlcode is set to 1403 and the sqlca.sqlerrm has the 1403 message followed by the series of 6512 errors at every stage in the calling stack where the excption is not handled.
However, in Value 2 above, we do not have any information about the actual error. The sqlca.sqlcode is set to 6512 and not the actual error code.
Is it possible that the error 6512 can be encountered by itself? What does it really signify when sqlca.sqlcode is set 6512?
Any information in this regard would be appreciated.
Regards,
Ram.
Received on Thu Feb 20 2003 - 13:26:57 CET