Re: Oracle reports parameter problem

From: Hilary Band <hband_at_csc.com>
Date: 22 Apr 2005 02:11:12 -0700
Message-ID: <5b489863.0504220111.7f9b26af_at_posting.google.com>


Stein Sebak <stein.sebak_at_gmail.com> wrote in message news:<42679311$0$344$4d4ebb8e_at_read.news.no.uu.net>...
> Hi
>
> I'm writing an "oracle reports builder" report which is called from a
> php web page that acts as a parameter form for the report. The report
> take 1 parameter, which is bookingnumber. Easy enough if the user can
> only enter 1 bookingnumber, but the parameter form that calls the report
> will allow the user to select a bunch of bookingnumbers (from 1 to appr 30).
>
> How can I make the SQL behind the report work without having to write
> something like
>
> AND BOOKINGNUMBER = INPUT_BNR1
> OR BOOKINGNUMBER = INPUT_BNR2
> etc?
>
> I want the code to loop through the booking numbers that I send to the
> report, like an array? Is it possible?
>
> An alternative could be to have the parameter form write all the
> bookingnumbers to a temporary oracle table, and the report will run on
> all booking numbers in that table - does that sound like a better solution?
>
> Any input appreciated.
>
> stein

If I were doing this by calling the Report from a Form, I would write the report query such that it was 'WHERE bookingnumber IN &p_booknum' (where p_booknum represents your parameter). In the Form I would have a muli-row block where the user could enter one or more booking numbers. When the report was called I would then have a function that would loop through the multi-row block in the form, build up a string in the format '(input_bnr1, input_bnr2, ...)' then return the formatted string. I would then pass this string through as the parameter for substitution into the query.

Perhaps you could do something similar with php? Received on Fri Apr 22 2005 - 11:11:12 CEST

Original text of this message