Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set serveroutput on
- DECLARE
- message varchar2(32767);
- error_message varchar2(512);
- BEGIN
- for msg in (
- select COURSE.COURSE_ID as "Code",
- COURSE_NAME as "Name",
- C_SEC_ID as "Sec",
- F_ID as "Fac"
- from COURSE_SECTION join COURSE
- on COURSE_SECTION.COURSE_ID = COURSE.COURSE_ID
- ) loop
- message:=msg.code || ', ' || msg.name || ', ' || msg.sec || ', ' || msg.fac;
- dbms_output.put_line(message);
- end loop;
- EXCEPTION
- when NO_DATA_FOUND then
- DBMS_OUTPUT.PUT_LINE('There is no data!');
- when others then
- error_message := SQLERRM;
- DBMS_OUTPUT.PUT_LINE('This program encountered the following error: ');
- DBMS_OUTPUT.PUT_LINE(error_message);
- END;
- /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement