Re: Implementing selectable LOV, how to...

From: <mclark_at_us.oracle.com>
Date: Thu, 13 Aug 1992 11:06:11 GMT
Message-ID: <1992Aug13.030611.1_at_us.oracle.com>


In article <1992Aug4.164432.12930_at_unixg.ubc.ca>, george_at_unixg.ubc.ca (George chow) writes:
> Hello,
> I'm trying to implement a LOV from which a user is allowed to pick multiple
> values. I'm thinking of something similar to the <Select Columns> in
> SQL*Forms's Default Block form. Other than that is is a pop-up page, I have no
> real idea of how to approach this. So has anyone here tried to do anything
> similar to this?
>
> George
>
>
Hi George,
This situation normally occurs when you have the following:  

Table A >---- Intersecting Table A/B ----< Table B (Pathetic attempt at E-R)

Where, say, Table B has a small number of rows, and we wish to populate Table A/B (The intersecting table with keys from A and B)

One way to do this is to Create a Block based upon A to enable the user to Query which "A" they would like to nominate the "B"'s for.

A short discussion of this technique follows:

Then Create a Block based upon "B".

Make Block "B" the Detail for Block "A" (This is why we rely on the small number of rows in "B")

Write a PRE-QUERY Trigger on BLock "B" to Highlight the Row Returned if a row exists in the intersection Table A/B. (using DISPLAY_FIELD)

Write trigger code to stop inserts/deletes in Block "B".

Nominate a function key to be the "Select a Row" key. Make this key change some detail in Block "B". This will force an Update in the Block which we can use to write/remove a row from the intersecting Table "A/B".
Also make the key highlioght/de-highlight the row using display_field.

   Re-Write the ON-UPDATE Processing to Insert/Delete the Row in the intersecting Table "A/B" depending upon whether the user has seleceted a new row or de-selected an existing row.

  Re-write the ON-LOCK Processing so that it does not lock table "B"

This was written in a Rush, so give me a Mailer if you have any problems (Assumes forms 3.0)

Thanks

Mark Clark (mclark_at_au.oracle.com) Received on Thu Aug 13 1992 - 13:06:11 CEST

Original text of this message