Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Local variables initialization

petezJul 28 2009 — edited Jul 28 2009
Hi,
I cannot find any information about PLSQL procedure/function local variables initialization values.
For example I have procedure:

PROCEDURE test_it (p1 IN NUMBER)
IS
v_local VARCHAR2(4000);
BEGIN

IF p1 IS NOT NULL THEN
v_local := 'VALUE ASSIGNED';
END IF;

DBMS_OUTPUT.PUT_LINE ( v_local );

END test_it;

I call two times

test_it ( 1 );
test_it ( NULL );

I am wonder if this is possible if output can be
VALUE ASSIGNED
VALUE ASSIGNED

Regards,
Piotr
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 25 2009
Added on Jul 28 2009
11 comments
1,879 views