//Hi,
//i create following table


Table name : person
ID AGE FNAME LNAME
1 10 Geek Greek
2 20 Seek Bells
3 30 Creek Dells
4 40 Sreek Sells[/B]

// I wrote following procedure which is run successfully.

Create or replace procedure proc1 as cursor person_cursor (pAge number) is select * from person p where p.age=pAge;
Begin
For I in person_cursor(30)
Loop
Dbms_output.put_line(i.fname);
End loop;
End proc1;


// but, to see output i must write "set serveroutput on" in sql stmt. Please tell me why we use "set serveroutput on" into prog.?
//Please tell me the neccesity of this line?

Thanks & regards,
Pooja

Recommended Answers

All 2 Replies

That is required only if you are using SQL * Plus. serveroutput is a environment variable. It must be switched ON to use the screen buffer and display the output on screen.

Thanks Mr. debasisdas.............

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.