Re: Help w/ this Fetch stmt
Posted in 1998
The table aliased to 'asi' does not
appear to be joined to any other table.
You are getting a cartesian product.
Jeff Larsen
larsen@qedc.com
kgeorgie@hotmail.com wrote:
>Hello Gurus. This FETCH statement is taking on avg. 2 minutes to return a
>row. Can anyone tell me why?
>
>Thanks
>
>
>The declare looks like this
>
>declare my_cursor cursor for
>
>select tg.sm_pay_grade,
> ail.asg_proj_arr_dt,
> se.mil_ets_dt,
> cos.asg_deros_dt>
>from
> curr_assignment ca,
> soldier s,
> soldier_grade sg,
> t_grade tg,
> asgn_instr_lose ail,
> mos_enld me,
> asi_enld asi,
> soldier_enlisted se,
> OUTER curr_os_asssignment cos
>
>where
> s.ind_ssn in (select a1.ind_ssn from asi_enld a1
> group by a1.ind_ssn having count(*) > 1) and
> asi.mil_asi_awd_dt in (select max(asi.mil_asi_awd_dt)
> from asi_enld a2 where
> a2.ind_ssn = s.ind_ssn)
>
>ca.uic = 'WASDDE' and
>s.rec_stat_indic in ('1','3') and
>s.ind_ssn = ail.ind_ssn and
>s.ind_ssn = me.ind_ssn and
>s.ind_ssn = se.ind_ssn and
>s.ind_ssn = cos.ind_ssn and
>s.ind_ssn = ca.ind_ssn and
>s.ind_ssn = sg.ind_ssn and
>s.mil_pers_clas_cd = 'E' and
>me.enl_mos_id = '75H' and
>me.occ_spc_desig_cd = 'P' and
>tg.army_mil_rank_cd = sg.army_mil_rank_cd and
>asi.ctrl_skl_indic_cd = 'H'
>
>
>THE FETCH IS AS SUCH:
>
>FETCH my_cursor INTO
> :sm_pay_grade,
> :proj_arr_dt,
> :mil_ets_dt,
> :asg_deros_dt;
>
>
>
>
>
>
>
>
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/ Now offering spam-free web-based newsreading