Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE
- CURSOR myCursor IS SELECT * FROM movie;
- minimum movie.price%TYPE;
- mPoint myCursor%ROWTYPE;
- BEGIN
- OPEN myCursor;
- SELECT MIN(price) INTO minimum FROM movie;
- DBMS_OUTPUT.PUT_LINE('The cheapest ticket costs Rs.' || minimum);
- DBMS_OUTPUT.PUT_LINE('The following movies cost Rs.' || minimum || ':-');
- FETCH myCursor INTO mPoint;
- WHILE myCursor%FOUND LOOP
- IF (mPoint.price = minimum) THEN
- DBMS_OUTPUT.PUT_LINE(mPoint.title||' staring ' || mPoint.star || '.');
- END IF;
- FETCH myCursor INTO mPoint;
- END LOOP;
- END;
- /
Add Comment
Please, Sign In to add comment