Help With Simple Function
669090Nov 6 2008 — edited Nov 6 2008I was wondering if someone could help me out with a simple function I'm trying to create. I'm kind of new to functions in oracle and I don't know the exact syntax or what it expects from me. I would appreciate it if someone could look at this and point out what I'm doing wrong.
CREATE OR REPLACE FUNCTION freshman_status_term(
pidm IN varchar2
)
RETURN varchar2 IS term
BEGIN
SELECT sgbstdn_term_code_eff INTO term
FROM sgbstdn
WHERE sgbstdn_pidm = pidm
AND sgbstdn_styp_code = 'F'
AND sgbstdn_stst_code = 'AS'
RETURN term;
END freshman_status_term;
The goal of the function is to find out the term for when a student is listed as a freshman. I keep getting errors though, so something must be wrong with it. Any help is appreciated. Thanks.