Home » SQL & PL/SQL » SQL & PL/SQL » problem in nested block (oracle 9i)
icon5.gif  problem in nested block [message #378102] Sun, 28 December 2008 22:34 Go to next message
tejas.patel
Messages: 22
Registered: December 2008
Location: NJ
Junior Member

Hello Sir/Friends

My problem is nested blocks ==> inner block in the outer block values and outer block in inner block value are print so, which method are used in that block. so please given me answer in short time.

DECLARE
v_customer VARCHAR2(50) := 'Womansport';
v_credit_rating VARCHAR2(50) := 'EXCELLENT';
BEGIN
DECLARE
v_customer NUMBER(7) := 201;
v_name VARCHAR2(25) := 'Unisports';
BEGIN
dbms_output.put_line('in cust==> '||v_customer);
dbms_output.put_line('in name==> '||v_name);
--dbms_output.put_line('in rate==> '||:v_credit_rating);
END;
dbms_output.put_line('out cust==> '||v_customer);
--dbms_output.put_line('out name==> '||v_name);
dbms_output.put_line('out rate==> '||v_credit_rating);
END;
Re: problem in nested block [message #378112 is a reply to message #378102] Mon, 29 December 2008 00:14 Go to previous messageGo to next message
panyam
Messages: 146
Registered: May 2008
Senior Member
Hi Tejas,

Pls Format the Post Before posting. I hope the below link will be usefull.

http://www.devshed.com/c/a/Oracle/Database-Interaction-with-PLSQL-Nested-Blocks-in-Depth/1/

Re: problem in nested block [message #378118 is a reply to message #378102] Mon, 29 December 2008 00:38 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
tejas.patel wrote on Mon, 29 December 2008 05:34
Hello Sir/Friends

My problem is nested blocks ==> inner block in the outer block values and outer block in inner block value are print so, which method are used in that block. so please given me answer in short time.

What keeps you from running the code?! You have the perfect testcase, which will show you exactly the answer you are seeking!
Re: problem in nested block [message #378121 is a reply to message #378118] Mon, 29 December 2008 01:05 Go to previous message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
According to me, Tejas wants to print those values which are commented.

and for that,

1> remove prefixed : from variable name
Quote:

--dbms_output.put_line('in rate==> '||:v_credit_rating);



2>you can not access the variables declared in inner block into outer block.

hope this will help.

regards,
Delna
Previous Topic: Oracle equivalent of SQL Server table-valued functions
Next Topic: Can anyone guide me...
Goto Forum:
  


Current Time: Mon Dec 05 04:42:04 CST 2016

Total time taken to generate the page: 0.15430 seconds