How would I go about catching this error before it got to the when others clause? I KNOW I NEED TO WRAP THE INNER BLOCK WITH A BEGIN AND END BUT I THINK I AM PUTTIN ONE OF THE BEGIN IN THE WRONG PLACE
Using oracle
CREATE OR REPLACE PROCEDURE example1
(
p_first_name IN varchar2)
as
v_test_variable varchar(4) := p_first_name;
BEGIN
BEGIN
DBMS_OUTPUT.PUT_LINE('Exception Propagation Example 1');
EXCEPTION
when others then
DBMS_OUTPUT.PUT_LINE('An error occured in the declaration section ');
END ;
EXCEPTION
WHEN value_error THEN
DBMS_OUTPUT.PUT_LINE('You cant put ['||V_TEST_VARIABLE || '] in a 4 character string.');
END example1;
/
show errors
EXEC EXAMPLE1('hello')
asked
Oct 10 '11 at 07:06 PM
in Default
sqlnewb
216
●
10
●
27
●
31