Created
December 22, 2014 19:47
-
-
Save JubbaSmail/f110f22b1104dcdd6c9f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE PROCEDURE GET_STUDENT_Mobile_BY_ID | |
( | |
std_id IN NUMBER | |
, std_mobile OUT NUMBER | |
) AS | |
BEGIN | |
select mobile into std_mobile from students where ID = std_id; | |
END GET_STUDENT_Mobile_BY_ID; | |
----------------------------------------------------- | |
CREATE OR REPLACE PROCEDURE GET_STUDENT_NAME_BY_ID | |
( | |
std_id IN NUMBER | |
, std_name OUT varchar2 | |
) AS | |
BEGIN | |
select name into std_name from students where ID = std_id; | |
END GET_STUDENT_NAME_BY_ID; | |
----------------------------------------------------- | |
CREATE OR REPLACE PROCEDURE GET_STUDENT_BY_COURSE_NUM | |
( | |
COURSE_NUM IN NUMBER | |
, STUDENT OUT SYS_REFCURSOR | |
) AS | |
BEGIN | |
open STUDENT for | |
select id,name,mobile from STUDENTS | |
where id in | |
( | |
select student_id from | |
( | |
select student_id, count(course_id) from STUDENT_COURSES | |
group by student_id | |
having count(course_id) = COURSE_NUM | |
) | |
); | |
END GET_STUDENT_BY_COURSE_NUM; | |
----------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment