error ORA 210001 [message #656954] |
Mon, 24 October 2016 12:00 |
|
yk107
Messages: 15 Registered: October 2015
|
Junior Member |
|
|
Hello we received an error ,from this chunk of code
EXCEPTION
WHEN OTHERS then
err_msg := 'Error encounted --> ' || sqlcode || substr(sqlerrm,1,100 ) || to_char( r_main.pidm ) ;
dbms_output.put_line(err_msg);
Raise_Application_Error ( sqlcode , substr(sqlerrm,1,50) || to_char( r_main.my_data ) );
error ORA 210001
sqlcode variable is initialized by oracle , how range of this variable is wrong
Thanks
|
|
|
Re: error ORA 210001 [message #656955 is a reply to message #656954] |
Mon, 24 October 2016 12:14 |
|
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
yk107 wrote on Mon, 24 October 2016 10:00Hello we received an error ,from this chunk of code
EXCEPTION
WHEN OTHERS then
err_msg := 'Error encounted --> ' || sqlcode || substr(sqlerrm,1,100 ) || to_char( r_main.pidm ) ;
dbms_output.put_line(err_msg);
Raise_Application_Error ( sqlcode , substr(sqlerrm,1,50) || to_char( r_main.my_data ) );
error ORA 210001
sqlcode variable is initialized by oracle , how range of this variable is wrong
Thanks
I don't believe you.
AFAIK, Oracle error number is maximum 5 digits long; not 6
The EXCEPTION handler is junk.
It should be completely REMOVED & DELETED since it does more harm than Good.
use COPY & PASTE to avoid posting incorrect "facts".
|
|
|
|
|
|
|
Re: error ORA 210001 [message #656967 is a reply to message #656959] |
Mon, 24 October 2016 13:22 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
exception handling is fine, however try to avoid the use of WHEN OTHERS because it masks any existing problems. An unhandled exception should blow up so you can see the error report and know exactly where and what the problem is.
|
|
|
Re: error ORA 210001 [message #656990 is a reply to message #656967] |
Tue, 25 October 2016 03:14 |
cookiemonster
Messages: 13925 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Just to be clear the error you actually got is this:
> oerr ora 21000
21000, 00000, "error number argument to raise_application_error of %s%s is out of range"
// *Cause:
// *Action: Use an error number in the range of -20000 to -20999, inclusive.
As the error message (and the documentation) says you can only use values between -20000 and -20999. Any error that wasn't the result of a call to raise_application_error will have a different error number.
Raise_application_error exists so you can create custom errors, it is not there to reformat existing oracle errors.
Read the link Michel posted.
Delete that pointless exception handler.
And next time you get an error and want help here make sure you post the correct error number.
|
|
|