Before running your PL/SQL block, you must enable server output.
set serveroutput on size unlimited
In versions older than 11g, us a number of bytes instead of "unlimited"
At first glance, there is a missing closing parenthesis for your SELECT subquery.
I have already set serveroutput to ON and that missing parenthesis was just typo.
Still It is not taking P_LOC and not executing cursor for loop.
1 person found this helpful
With v_loc in single quotes, it is treated as a literal, not as a cursor variable. Same with p_loc further down.
Still It's not displaying employee info in the cursor for loop.
Thank you very much Brian. It worked alright in second try.
On another note,
can you tell me what is the difference between set serveroutput on to unlimited size and set serveroutput on to no of bytes.How can we know the no of bytes.
serveroutput sets how large of a buffer sqlplus maintains for DBMS_OUTPUT. In older versions you would set it to any number of bytes larger than your expected output via DBMS_OUTPUT. (I often used 1000000.)
Current versions of sqlplus introduced the option of unlimited to avoid overflowing the DBMS_OUTPUT buffer.