光標在那裏檢查學生的資格。然而,我甚至不能編譯,因爲我不斷收到一些錯誤的腳本:我有幾個錯誤的PLS-00049
[Error] PLS-00049 (395: 46): PLS-00049: bad bind variable 'SORLCUR_PIDM'.
CURSOR C_ENSP IS
SELECT SFRENSP_ESTS_CODE
,STVESTS_DESC
FROM STVESTS,SFRENSP
WHERE SFRENSP_PIDM = :Sorlcur_PIDM
AND SFRENSP_TERM_CODE = :sorlcur_TERM_CODE
AND SFRENSP_KEY_SEQNO = :SORLCUR_KEY_SEQNO
AND STVESTS_CODE = SFRENSP_ESTS_CODE;
CURSOR C_ENSP_SECOND IS
SELECT 'Y'
FROM SORLCUR, SFRENSP
WHERE SORLCUR_PIDM = :Sorlcur_PIDM
and SORLCUR_PIDM = SFRENSP_PIDM
AND sorlcur_TERM_CODE = :sorlcur_TERM_CODE
AND sorlcur_TERM_CODE = SFRENSP_TERM_CODE
AND SORLCUR_CURRENT_CDE = 'Y'
AND SORLCUR_CACT_CODE = 'ACTIVE'
AND SORLCUR_LMOD_CODE = 'LEARNER'
AND SORLCUR_PRIORITY_NO = 2
AND SFRENSP_KEY_SEQNO = SORLCUR_KEY_SEQNO
AND SFRENSP_ESTS_CODE NOT IN ('W', 'X' , 'Z');
v_ENSP_SECOND VARCHAR2(1);
CURSOR c_cohort IS
SELECT chrt.sgrchrt_chrt_code
FROM sgrchrt chrt
WHERE sgrchrt_pidm = :sorlcur_pidm
AND NVL(chrt.sgrchrt_stsp_key_sequence,99999999) = :sorlcur_key_seqno
AND NVL(sgrchrt_term_code_eff,'~') = :stvterm_term_code;
CURSOR c_resd IS
SELECT sgbstdn_resd_code,stvresd_desc
FROM sgbstdn,stvresd
WHERE SGBSTDN_PIDM = :KEY_BLOCK.PIDM
AND SGBSTDN_TERM_CODE_EFF = :KEY_BLOCK.STVTERM_TERM_CODE
AND stvresd_code = sgbstdn_resd_code;
cursor c1 is
select skricas_cas_number,
skricas_cas_status
from skricas a
where a.SKRICAS_PIDM = :key_block.PIDM
and exists (select 'x' from sorlcur
where sorlcur_pidm = skricas_pidm
and sorlcur_seqno = skricas_lcur_seqno
and sorlcur_term_code = :key_block.stvterm_term_code)
and skricas_cas_status = 'USED'
and skricas_cas_exp_date = (select max(a1.skricas_cas_exp_date)
from skricas a1
where a1.skricas_pidm = a.skricas_pidm
and a1.skricas_cas_status = a.skricas_cas_status
);
-- TT06987 start
CURSOR get_JSopt_in IS
SELECT szrasop_opt_in
FROM szrasop
WHERE szrasop_pidm = :sorlcur.Sorlcur_PIDM
AND szrasop_term_code = :sorlcur.Sorlcur_TERM_CODE;
--- v_elig VARCHAR2(1);
CURSOR get_max_szrolps IS
SELECT MAX(SZROLPS_SEQ_NO)
FROM SATURN.SZROLPS
WHERE SZROLPS_PIDM = :sorlcur.Sorlcur_PIDM
AND SZROLPS_TERM_CODE = :sorlcur.Sorlcur_TERM_CODE;
v_max_stage szrolps.szrolps_seq_no%TYPE;
-- TT06987 end
BEGIN
IF :sorlcur_program IS NOT NULL THEN
:SORLCUR_SMRPCMT_TEXT := F_UOG_GET_COMMENT(:sorlcur_program, :sorlcur_term_code, 'PRGTIT');
OPEN C_ENSP;
FETCH C_ENSP INTO :SFRENSP_ESTS_CODE, :ESTS_DESCRIPTION;
CLOSE C_ENSP;
OPEN C_ENSP_SECOND;
FETCH C_ENSP_SECOND INTO v_ENSP_SECOND ;
IF C_ENSP_SECOND%NOTFOUND THEN
:secondary_prog := 'N';
ELSE
:secondary_prog := 'Y';
END IF;
CLOSE C_ENSP_SECOND;
END IF;
OPEN c_cohort;
FETCH c_cohort
INTO :ENTRY_COHORT;
CLOSE c_cohort;
OPEN c_resd;
FETCH c_resd
INTO :sgbstdn_resd_code,:stvresd_desc;
CLOSE c_resd;
SELECT STVATTS_DESC
INTO :mode_desc
FROM STVATTS
WHERE :sorlcur_mode_code = STVATTS.STVATTS_CODE
AND STVATTS.STVATTS_CODE LIKE 'M%';
select stvstyp_desc
into :sorlcur.styp_desc
from stvstyp
where :SORLCUR_STYP_CODE = stvstyp_code;
:sorlcur.SITE_DESC := gb_stvsite.f_get_description(:SORLCUR_SITE_CODE);
get_last_section_completed;
-- added by Mary for 5095
open c1;
fetch c1 into :cas_number,
:cas_status;
close c1;
-- TT06987 start
-- Student eligible??
IF hwzkimag.F_eligible_js (:sorlcur.Sorlcur_PIDM, :sorlcur.sorlcur_TERM_CODE)
THEN
:optin_elig := 'Y';
END IF;
--message(:optin_elig);message(:optin_elig);
IF NVL(:optin_elig,'XXX') = 'Y' THEN
OPEN get_max_szrolps;
FETCH get_max_szrolps
INTO v_max_stage;
CLOSE get_max_szrolps;
-- ELigible and got passed the opt in/opt out stage 7.
IF v_max_stage >= 7 THEN
OPEN get_JSopt_in;
FETCH get_JSopt_in
INTO :optin_yes;
CLOSE get_JSopt_in;
set_item_property('jsopt_message',visible,property_false);
-- Eligible but has not passed opt in/opt out stage 7.
ELSE
:jsopt_message := 'OLR not complete';
set_item_property('jsopt_message',visible,property_true);
END IF;
END IF;
-- TT06987 end
一旦我脫掉「:」從:sorlcur_PIDM,然後我得到一個無效的標識符錯誤,我還檢查我的表與列名和心不是任何差異。 –
發佈您的完整代碼或其他內容,其中給出了您正在嘗試執行的操作的概述 – XING
@XING ..我已經使用完整代碼編輯了文章 –