Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Why I need to initialize this varable to NULL
I got a little confused here. Say i have a procedure
Procedure A ( .., o_a OUT VARCHAR2(10) )
v_a VARCHAR2(10);
BEGIN v_a := NULL;
..
..
IF someThingHappen THEN
v_a:=someNewValue;
END IF;
o_a:= v_a;
END A; Why I need to initialize the v_a:=NULL in BEGIN section? AS I read the PL/SQL guide, that in procedure body when v_a was created, its default value is NULL as its type is VARCHAR2(10). So if someThingHappen is not there, v_a should be automatically as NULL. Am I right? Thanks anyone clear out this for me.
C Chang Received on Sun Sep 22 2002 - 23:03:37 CDT
![]() |
![]() |