Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Referencing a Variable When Calling a Function

669090Nov 7 2008 — edited Nov 7 2008
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 5 2008
Added on Nov 7 2008
20 comments
2,024 views