Re: HELP: Single form - multiple table names
Date: Wed, 24 Jun 1998 15:12:28 +0100
Message-ID: <6mr1fp$af9$1_at_schbbs.mot.com>
I haven't tried this before so a little guess work coming up.
Create a view whihc is the union of of all the tables you are interested in. Make sure that the view also contains and extra column which represents the table name. something like:
select 'TABLE1', col1, col2...
from table1
union 'table2', col1, col2...
from table2
union
etc etc
in your form you could dynamically assign the defautl where clause based on the table name selected in your control block using SET_BLOCK_PROPERTY builtin. This would then allow you to choose which table to quesry from by querying against the first column of the view.
As for updates and inserts and deletes. Well, the first column, whether displayed or not, will identify the correct table to be updated so you could write ON-INSERT, ON-DELETE and ON-UPDATE triggers to hit the appropriate table.
This is a little simplified but should give you food for thought.
Let me know, via email, how it goes
-- Alan D. Mills schapin_at_my-dejanews.com wrote in message <6mogan$jc6$1_at_nnrp1.dejanews.com>...Received on Wed Jun 24 1998 - 16:12:28 CEST
>Using Oracle Forms 4.5
>
>We have a multitude of tables which all have the same table definition
>(column names and data types). We would like to have one Oracle Form which
>prompts the user for a table name; and then pulls column information from
the
>specified table.
>
>So, the form will perform just like any other form, but the display will
refer
>to the user-entered table. All querys, updates will affect the
user-entered
>table.
>
>Can it be done? I appreciate any help!
>
>Thank you,
>Steve Chapin
>schapin_at_energygraphics.com
>
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/ Now offering spam-free web-based newsreading