Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> how to validate incoming pl/sql arguments for type/size?
My procedures have been generating 'ORA-01401: inserted value too
large for column' errors when I try to insert runtime parameters into
tables. I would like to catch this before an insert attempt is made,
but I'm not sure of the best way to proceed.
For example, if I was accepting an incoming parameter of type CHAR(8) and I wanted to verify that it was not a string of length <= 8, what would be the best way to do that, syntax-wise?
My ideal, I suppose, would be:
IF (F_PARAMETER_DOES_NOT_FIT_INTO_TYPE( p_my_parameter, table.col%TYPE
) ) THEN
RAISE a custom exception;
END IF
Can a column '%TYPE' be passed as an argument to a function?
Here is my proc declaration:
PROCEDURE MYPROC( P_MY_NUMBER IN [TABLE_NAME].[COLUMN_NAME]%TYPE ); Thanks. Received on Mon Jul 07 2003 - 13:35:51 CDT