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!

Help With Simple Function

669090Nov 6 2008 — edited Nov 6 2008
I 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 4 2008
Added on Nov 6 2008
21 comments
969 views