Link to home
Start Free TrialLog in
Avatar of scissorhand
scissorhand

asked on

Display result in PL/SQL

begin
coll.countStudent();
end;


The procedure countStudent contains sql that display the result of the query.
But I only get this message:
PL/SQL complete successfully

How to get the output? I have tried using
set serveroutput on

but still get the same result
Avatar of montonen
montonen

Hi.

If you want output from a PL/SQL procedure...
use:

DBMS_OUTPUT.PUT_LINE('TEXT GOES HERE' || sSomeVariable);

Do this while looping thrue the cursor for the SELECT statment.

Normally you don't want output from PL/SQL... except form return values. DBMS... is good for debugging though.

Regards
Jonas Montonen
You must have the SERVEROUTPUT variable set to ON to see the output.

Set it to OFF to stop the SP from displaying output.
hi
If you call your procedure from SqlPlus(Worksheet), you should set variable
set serveroutput on;
Avatar of scissorhand

ASKER

Sorry to tell u that I use a telnet to connect to my college server. I have on serveroutput but still can not
Also this procedure is created using java and register it to the system. I use system.out.println
Also this procedure is created using java and register it to the system. I use system.out.println
ASKER CERTIFIED SOLUTION
Avatar of SDutta
SDutta

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanx for your help. I just need a statement to complete my work