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

Home -> Community -> Usenet -> c.d.o.misc -> Why I need to initialize this varable to NULL

Why I need to initialize this varable to NULL

From: C Chang <cschang_at_maxinter.net>
Date: Mon, 23 Sep 2002 00:03:37 -0400
Message-ID: <3D8E9299.555F@maxinter.net>


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

Original text of this message

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