Yurttas/PL/DBL/oracle/F/02/Movie/q01.sp

From ZCubes Wiki
Revision as of 23:26, 4 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="text" line start="1" enclose="div"> →‎REM REM q01.sp REM REM Find all movies produced by 'Paramount' REM studios in between 1990 - 1995. REM: CREATE...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1/*
 2REM
 3REM q01.sp
 4REM
 5REM Find all movies produced by 'Paramount'
 6REM studios in between 1990 - 1995.
 7REM
 8*/
 9
10CREATE OR REPLACE
11PROCEDURE q01 IS
12
13  CURSOR movie_cursor IS 
14    SELECT title 
15    FROM Movie
16    WHERE studioname = 'Paramount'
17      AND year BETWEEN 1980 AND 1995;
18
19  movie_rec movie_cursor%ROWTYPE;
20
21BEGIN
22
23  OPEN movie_cursor;
24
25  DBMS_OUTPUT.PUT_LINE('Title');
26
27  FETCH movie_cursor INTO movie_rec;  
28
29  WHILE movie_cursor%FOUND 
30  LOOP
31    DBMS_OUTPUT.PUT_LINE(movie_rec.title);             
32    FETCH movie_cursor INTO movie_rec;
33  END LOOP;
34
35END q01;
36/