Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> %type behaviour differs for variable declarations and function parameters
Hi all,
I just discovered a very annoying behaviour (TMHO) in PL/SQL for Oracle 7.3:
suppose a table T1 is created with attrib A1, varchar2(10)
then a procedure
procedure P1(par1 in T1.A1%type)
is
begin
...
end;
at first sight what is expressed in this procedure declaration is that a
parameter of type string , with a
precision of 10 characters is passed. Nevertheless
ONE CAN PASS STRINGS LONGER THAN 10 CHAR TO THIS PROCEDURE!!
when you think of it, it makes sense. You cannot write something like
procedure P2(par1 in varchar2(10))
is
begin
...
end;
so for parameters PL/SQL uses only the varchar2 part for the %type, not the (10) part. Received on Mon Nov 02 1998 - 09:09:36 CST