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 -> %type behaviour differs for variable declarations and function parameters

%type behaviour differs for variable declarations and function parameters

From: Bram Stieperaere <bse_at_NO_SPAMsodexho-pass.be>
Date: Mon, 2 Nov 1998 16:09:36 +0100
Message-ID: <71ki1c$c91$1@news3.Belgium.EU.net>


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

Original text of this message

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