Re: FETCH Troubles!
From: Scott J. Little <slittle_at_rmc1.crocker.com>
Date: 1995/05/07
Message-ID: <slittle-0705952253440001_at_iplink105.crocker.com>#1/1
Date: 1995/05/07
Message-ID: <slittle-0705952253440001_at_iplink105.crocker.com>#1/1
In article <3ogii0$kpc_at_homer.alpha.net>, sahmad_at_mfa.com (Saad Ahmad) asked:
> could you post the whole code, exactly ...?
OK, here it is from the Pro*C program.
if (!sCursDeclared) {
/* debugging */ if (trace_flag) { printf("\tTerm: %s. \n\tCourse: %s.\n", szGTerm, szGCourse); printf("\tCollege: %s.\n\tDept: %s.\n", szGCollege, szGDept); printf("\tInstructor: %s.\n", szGInstructorID); } EXEC SQL DECLARE InstrCourseCurs CURSOR FOR SELECT sirasgn_crn, sirasgn_pidm FROM saturn.sirasgn, saturn.ssbsect, saturn.scbcrse, saturn.spriden WHERE sirasgn_term_code = :szGTerm AND ssbsect_term_code = sirasgn_term_code AND ssbsect_crn = sirasgn_crn AND ssbsect_crse_numb like :szGCourse AND scbcrse_subj_code = ssbsect_subj_code AND scbcrse_crse_numb = ssbsect_crse_numb AND scbcrse_csta_code = 'A' AND scbcrse_eff_term <= :szGTerm AND scbcrse_coll_code = :szGCollege AND scbcrse_dept_code like :szGDept AND spriden_pidm = sirasgn_pidm AND spriden_change_ind is NULL AND spriden_id like :szGInstructorID ORDER BY spriden_last_name, spriden_first_name, ssbsect_subj_code, ssbsect_crse_numb, ssbsect_seq_numb; POSTORA; if (trace_flag) printf("Cursor was set up, now opening....\n"); EXEC SQL OPEN InstrCourseCurs; POSTORA; if (trace_flag) printf("Cursor was opened, now about to fetch....\n"); sCursDeclared = true;
} /* end of if cursor is not declared */
/* now fetch an instructor and a course */ EXEC SQL FETCH InstrCourseCurs INTO
:szGCourseID :sCourseID_Ind, :szGInstrPIDM :sInstrPIDM_Ind;POSTORA; and this is from the sql*plus statement that I ran.
SELECT sirasgn_crn, sirasgn_pidm
FROM saturn.sirasgn, saturn.ssbsect, saturn.scbcrse,
saturn.spriden
WHERE sirasgn_term_code = &&szGTerm
AND ssbsect_term_code = sirasgn_term_code AND ssbsect_crn = sirasgn_crn AND ssbsect_crse_numb like &&szGCourse AND scbcrse_subj_code = ssbsect_subj_code AND scbcrse_crse_numb = ssbsect_crse_numb AND scbcrse_csta_code = 'A' AND scbcrse_eff_term <= &&szGTerm AND scbcrse_coll_code = &&szGCollege AND scbcrse_dept_code like &&szGDept AND spriden_pidm = sirasgn_pidm AND spriden_change_ind is NULL AND spriden_id like &&szGInstructorID ORDER BY spriden_last_name, spriden_first_name, ssbsect_subj_code, ssbsect_crse_numb, ssbsect_seq_numb;
Any ideas you have would be helpful.
thanks
sjl
-- Scott J. Little slittle_at_rmc1.crocker.com | http://crocker.com/~slittle ..................................................................... You and I, we reject these narrow attitudes We add to each other, like a coral reef - Neil Peart, Rush Building bridges on the ocean floor "Alien Shore" Reaching for the alien shore [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[']]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]Received on Sun May 07 1995 - 00:00:00 CEST