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!

cursor and dbms_output

user10274093Apr 27 2015 — edited Apr 29 2015

Hi all,

on 11.2.0.4,

I have a table :

SQL> desc details

Name Null? Type

----------------------------------------- -------- ---------------

EMPRUNT NOT NULL NUMBER(10)

NUMERO NOT NULL NUMBER(3)

ISBN NUMBER(10)

EXEMPLAIRE NUMBER(3)

RENDULE DATE

This query returns some rows :

Capture.PNG

But when I want to use that in a PL/SQL I have nothing :

set serveroutput on

Declare

nombre_emp number(10);

 CURSOR C\_EMP Is

 SELECT isbn

INTO nombre\_emp

FROM details

group by isbn

;

Begin

 DBMS\_OUTPUT.ENABLE( 1000000 ) ;

 For C in C\_EMP Loop

    DBMS\_OUTPUT.PUT\_LINE( 'MCNT -> ' || nombre\_emp ) ;

    DBMS\_OUTPUT.NEW\_LINE ;        

 End loop ;

End ;

/

MCNT ->

MCNT ->

MCNT ->

MCNT ->

MCNT ->

MCNT ->

MCNT ->

MCNT ->

MCNT ->

MCNT ->

MCNT ->

PL/SQL procedure successfully completed.

Thanks for help.

This post has been answered by John Stegeman on Apr 28 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 27 2015
Added on Apr 27 2015
22 comments
2,170 views