Re: forms4.5 sorting - help needed

From: Steve Cosner <stevec_at_zimmer.CSUFresno.EDU>
Date: 1996/08/13
Message-ID: <4uqc94$mtj_at_zimmer.CSUFresno.EDU>#1/1


In article <320F331D.4AB4_at_datamed.co.at>, Johannes Kribbel <kribbel_at_datamed.co.at> wrote:
>I need to order the records of a tabular block by a non-basetable-item
>which is filled by a post-query trigger. I cannot use a view with a
>join because I need to update data.
>
>more infos:
>I have two tables 1) table A (param_id number, value number, ...)
> 2) table B (id number, param_name varchar, ...)
>My block (with Basetable A) should look like:
>
> Parameter | Value
> ----------------------------
> <B.param_name> | <A.value>
> ... |
>
>Item <param_id> is hidden, <param_name> is the non-basetable item,
><value> should be updateable and the rows should be ordered by
><param_name>. A view with A and B joined by A.param_id=B.id as a
>basetable for the block would be sortable but it's not possible to
>update through a view.

You can do it by tricking the form.

Create your base-table block, with the non-base-table item set up as you have. In an on-select trigger, bypass standard query processing by creating your own cursor and fetch loop to populate the block.

The on-select trigger should open a cursor that accesses your two-table view containing the desired order-by clause. Using a loop to fetch the records from your view, populate the block row-by-row. Be sure to use next_record for each new fetch. Also be sure the view and your cursor contain the base-table's rowid so you can fetch it into the base-table block.

After this trigger, your form should run as a normal base-table block, allowing you to do the standard updating.

Hope this helps.
Steve Cosner Received on Tue Aug 13 1996 - 00:00:00 CEST

Original text of this message