Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

dynamic sql ref cursor and dynamic using clause

Mark ReichmanMar 4 2008 — edited Mar 4 2008
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;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2008
Added on Mar 4 2008
1 comment
439 views