Re: when will the DBMS_OUTPUT.PUT_LINE not work???
Date: Thu, 29 Mar 2001 16:50:51 +0200
Message-ID: <3AC34BCB.2F583228_at_renault.com>
" srcnckpc"_at_hotmail.com a écrit :
>
> Here's my code.However the DBMS_OUTPUT.PUT_LINE simply does not display
> the variables in SQL. What is wrong?
>
> DECLARE
>
> TYPE rooms_table_type IS TABLE OF rooms%ROWTYPE
> INDEX BY BINARY_INTEGER;
>
> rooms_table rooms_table_type;
>
> v_room classes.room_id%TYPE;
> v_dept classes.department%TYPE;
> v_course classes.course%TYPE;
>
> BEGIN
>
> FOR i IN 99999 .. 99991 LOOP
>
> SELECT *
> INTO rooms_table(i)
> FROM rooms
> WHERE room_id = i;
>
> SELECT classes.room_id, classes.department, classes.course
> INTO v_room, v_dept, v_course
> FROM classes, rooms
> WHERE classes.room_id = rooms.room_id;
>
> END LOOP;
>
> DBMS_OUTPUT.PUT_LINE(' This is the course' || v_course);
>
> END;
> /
>
> v_course is not displaying at all but 'this is the course' shows up
> correctly.
> Thanks,
> SRC
I think " FOR i IN 99999 .. 99991 LOOP" is wrong!
You should write your numbers in ascending order.
" FOR i IN 99991 .. 99999 LOOP"
Try to put "DBMS_OUTPUT.PUT_LINE(' i am in the loop');"
in your loop, you'll see it is not displayed.
Received on Thu Mar 29 2001 - 16:50:51 CEST