I'm trying to create a procedure which gets the module information by student id.
Quote:
SET SERVEROUTPUT ON; CREATE OR REPLACE PROCEDURE get_modules_info_by_student_id (student_id NUMBER) AS v_name modules.name%TYPE; v_created date modules.created date%TYPE; BEGIN SELECT name, created DATE INTO v_name, v_created DATE, v_hire_date, v_update_date FROM courses WHERE student_id = student_id; DBMS_OUTPUT.PUT_LINE('Student_ID: ' || student_id); DBMS_OUTPUT.PUT_LINE('name: ' || v_name); DBMS_OUTPUT.PUT_LINE('created_date: ' || v_created DATE); EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE('Student_ID ' || student_id || ' not found.'); end; / |
Quote:
Warning: Procedure created with compilation errors. SQL> SHOW ERROR; Errors for PROCEDURE GET_MODULES_INFO_BY_STUDENT_ID: LINE/COL ERROR -------- ----------------------------------------------------------------- 5/19 PLS-00103: Encountered the symbol "MODULES" when expecting one of the following: := . ( @ % ; not null range with default character |