Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> How to get maximum allowed length when using %type for varchar?
Quite often I need to know the length of the string I am allowed to
assign to my_var, when my_var is declared using %type. For example,
when I have defined
create my_table( my_varchar2_col varchar2(10) );
declare
my_var my_table.my_varchar2_col%type;
begin
my_var := substr( 'A large string, that exceeds the size of
my_var...'
, 1
, max_length
);
then I need to know the value for max_length.
I know it can be found in all_tab_columns or user_tab_columns. Is there an easier way to get this value? Or another function instead of substr(..) ?
Thanks,
Arjan.
Received on Sun Oct 04 1998 - 08:44:30 CDT
![]() |
![]() |