tokerago13
Programmer
Hi,
I have never used plsql tables before. I am trying to retrieve the last two rows from a cursor. What I intend to do is use the individual variables for each of the rows to carry out some calculations between the two rows. The set of record being retrieved is a mix of old and new data. By adding these, I can get a total number which is what I require.
What I have done so far is thus:
dfine the variables
holiday_rec c1%rowtype;
TYPE t_holidayrec IS TABLE OF holiday_rec index by binary_integer;
v_holidaytab t_holidayrec;
last_hol_rec holiday_rec;
prev_hol_rec holiday_rec;
Hre I'm tryng to fetch the records... What next
for holiday_rec in c1 loop
v_holidaytab := 'x';
v_holidaytab(x).choice := x.col1;
v_holidaytab(x).enrt_cvg_strt_dt := x.col2;
v_holidaytab(x).enrt_cvg_thru_dt := x.col3;
v_holidaytab(x).prtt_enrt_rslt_stat_cd := x.col4;
v_holidaytab(x).effective_start_date := x.col5;
v_holidaytab(x).effective_end_date := x.col6;
v_holidaytab(x).lf_evt_ocrd_dt := x.col7;
v_holidaytab(x).asg_effective_start_date := x.col8;
v_holidaytab(x).person_id := x.col9;
v_count := v_count + 1;
end loop;
Any help will be much appreciated.
Tny
I have never used plsql tables before. I am trying to retrieve the last two rows from a cursor. What I intend to do is use the individual variables for each of the rows to carry out some calculations between the two rows. The set of record being retrieved is a mix of old and new data. By adding these, I can get a total number which is what I require.
What I have done so far is thus:
dfine the variables
holiday_rec c1%rowtype;
TYPE t_holidayrec IS TABLE OF holiday_rec index by binary_integer;
v_holidaytab t_holidayrec;
last_hol_rec holiday_rec;
prev_hol_rec holiday_rec;
Hre I'm tryng to fetch the records... What next
for holiday_rec in c1 loop
v_holidaytab := 'x';
v_holidaytab(x).choice := x.col1;
v_holidaytab(x).enrt_cvg_strt_dt := x.col2;
v_holidaytab(x).enrt_cvg_thru_dt := x.col3;
v_holidaytab(x).prtt_enrt_rslt_stat_cd := x.col4;
v_holidaytab(x).effective_start_date := x.col5;
v_holidaytab(x).effective_end_date := x.col6;
v_holidaytab(x).lf_evt_ocrd_dt := x.col7;
v_holidaytab(x).asg_effective_start_date := x.col8;
v_holidaytab(x).person_id := x.col9;
v_count := v_count + 1;
end loop;
Any help will be much appreciated.
Tny