Can you have a dynamic "using" clause? I am using an Oracle Form as a parameter form. If the user doesnt fill in a parameter, I dont include it in the where clause... I build the v_new_hal_select_str where clause together dynamically. So, depending on the where clause I need to alter the order and content of the using clause? I cannot seem to find any examples of such a thing...
OPEN new_hal_cursor
FOR v_new_hal_select_str
USING p_hal_report_param_rec.target_year,
p_hal_report_param_rec.target_type,
p_hal_report_param_rec.compare1_year,
p_hal_report_param_rec.compare1_type,
p_hal_report_param_rec.target_year,
p_hal_report_param_rec.target_type,
p_hal_report_param_rec.compare2_year,
p_hal_report_param_rec.compare2_type,
p_hal_report_param_rec.target_year,
p_hal_report_param_rec.target_type,
p_hal_report_param_rec.compare3_year,
p_hal_report_param_rec.compare3_type,
p_hal_report_param_rec.target_year,
p_hal_report_param_rec.target_type;
FETCH new_hal_cursor
BULK COLLECT INTO v_new_hal_tab;
CLOSE new_hal_cursor;