I want to use a variable I have created when I call a certain function. It appears that I may be going about it the wrong away. Can someone take a look at this and tell me if it's possible or maybe how to achieve the result I'm trying for? It would be nice to use the variable anywhere in my whole script besides just inside a certain block.
This is my code:
DECLARE
continuing_term varchar2(6);
BEGIN
SELECT MIN(sgbstdn_term_code_eff)
INTO continuing_term
FROM sgbstdn
WHERE sgbstdn_pidm = '216520'
AND sgbstdn_styp_code = 'C'
AND sgbstdn_stst_code = 'AS';
SELECT substr(f_concat_as_of_cum_gpa('216520', continuing_term ,'UG','I'),14,3) FROM dual;
END;
/
I'm getting the error that an into clause is expected at the second SELECT statement.