Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Column length question.
On Nov 21, 4:14 pm, Serguei.Goumeni..._at_cibc.ca wrote:
> Dear Experts,
> As I know it is possible to use in stored procedures a column type
> definition for a variable declaration like the following:
>
> myVariable tableName.columnName%TYPE;
>
> Is it possible (and how) to use a column size definition? Something
> like:
>
> IF (length(myVariable) > tableName.columnName%SIZE) THEN
> .... do something ....
> END IF;
>
> Regards,
> Serguei.
The general rule in Oracle is, when it is not documented, it doesn't exist. There are no magical secrets, and if they are there you're not supposed to use them. The %SIZE attribute does not exist. You can simply trap the error when you exceed the column length. This has the advantage you are not introducing redundant tests, to make your code purposefully slow.
-- Sybrand Bakker Senior Oracle DBAReceived on Tue Nov 21 2006 - 09:47:08 CST