Re: populate a data block

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Fri, 11 Oct 2002 17:22:23 GMT
Message-ID: <3DA708AA.26172240_at_exesolutions.com>


Timbo wrote:

> Daniel Morgan wrote:
> > Timbo wrote:
> >
> >
> >>Hi. New to Forms. Using 9i dev suite.
> >>
> >>I want to have a control block on a form where a user enters a date,
> >>and then run a query to populate the data block using the date
> >>entered from the control block as the WHERE value. The data in the
> >>data block is query only, the user will make a selection from the
> >>returned data to do something else.
> >>
> >>How do I make the control block entry populate the data block?
> >>
> >>Thanks,
> >>
> >>Tim
> >
> >
> > I try to keep as much code out of a form as possible. One simple way to
> > do this is to in the validation trigger call a stored procedure in the
> > database to populate the table. Then your code consists only of the
> > following:
> >
> > BEGIN
> > back_end_proc(:block_name.date_field);
> > GO_BLOCK('block_name');
> > EXECUTE QUERY;
> > END;
> >
> > Let the proc contain the INSERT INTO using the passed date value as a
> > parameter to the WHERE clause.
> >
> > Keeps the form leaner and faster.
> >
> > Daniel Morgan
> >
> Thanks for the tip.
>
> When I write the PL/SQL procedure and store it on the database,
> do I reference all the form methods the same way? Such as the
> set_block_property ?
>
> Tim

Code in the back-end can never reference the form. Code in the form references the backend. So use back-end code to load tables. Then just refresh the form with EXECUTE_QUERY.

Daniel Morgan Received on Fri Oct 11 2002 - 19:22:23 CEST

Original text of this message