Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Column length question.

Re: Column length question.

From: sybrandb <sybrandb_at_gmail.com>
Date: 21 Nov 2006 07:47:08 -0800
Message-ID: <1164124028.679419.5690@h48g2000cwc.googlegroups.com>

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 DBA
Received on Tue Nov 21 2006 - 09:47:08 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US