OK, so, I've modified my routines AGAIN slightly. I really just want to know is how to handle if there's a parm type mismatch(in this case a varchar was passed in while the procedure was expecting a number). One routine expects a number and the other a varchar2. I just re-display the input parm.

If I make this call

http://iasdev.ucr.edu/media_test/test_harness.test_number_v?number_in=a

I get this error

Error: ORA-06502: PL/SQL: numeric or value error: character to number conversion error

Using this code

PROCEDURE test_number_v(number_in IN VARCHAR2) IS
v_number_in NUMBER;
param_type_mismatch EXCEPTION;
PRAGMA EXCEPTION_INIT(param_type_mismatch, -06502);
BEGIN
v_number_in := to_number(number_in);
htp.p('Result: ' || v_number_in);
EXCEPTION
WHEN param_type_mismatch THEN
htp.p('Error: ' || SQLERRM);
--RAISE;
END test_number_v;

If I make this call

http://iasdev.ucr.edu/media_test/test_harness.test_number_n?number_in=a

I get this error

Mon, 11 Aug 2014 16:41:12 GMT
Failed to execute target procedure ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at line 35
DAD name: media_test
PROCEDURE : test_harness.test_number_n
URL : http://iasdev.ucr.edu:80/media_test/test_harness.test_number_n?number_in=a
PARAMETERS :
===========
number_in:
a
ENVIRONMENT:
============
PLSQL_GATEWAY=WebDb
GATEWAY_IVERSION=2
SERVER_SOFTWARE=Oracle-Application-Server-11g
Blah..Blah..Blah

Using this code

PROCEDURE test_number_n(number_in IN NUMBER) IS
v_number_in NUMBER;
param_type_mismatch EXCEPTION;
PRAGMA EXCEPTION_INIT(param_type_mismatch, -06502);
BEGIN
v_number_in := number_in;
htp.p('Result: ' || v_number_in);
EXCEPTION
WHEN param_type_mismatch THEN
htp.p('Error: ' || SQLERRM);
--RAISE;
END test_number_n;

So, I was asking is how do I capture if a valid number was passed into a procedure. Should I pass a varchar2 and try to "to_number" it?? I consider the first version a little more elegant response to an end user than the second version.

Example from above...

v_number_in := to_number(number_in);