Re: base table in runform

From: Tommy Wareing <p0070621_at_oxford-brookes.ac.uk>
Date: 7 Nov 1993 05:52:53 -0600
Message-ID: <CG4E7n.AEJ_at_uk.ac.brookes>


Ha Kong Kuen (kkha_at_hkuxa.hku.hk) wrote:
> Is it possible to dynamically change the base table of a form based
> on some paramters?

In a way, yes. You need to use a view to do it though. Basically what you need is:
CREATE VIEW multiple_tables AS
SELECT 1 table_no, table1.<stuff>
FROM table1
UNION
SELECT 2, table2.<stuff>
FROM table2
etc.

and then base your block on the view multiple tables. Having decided which table you wish to query on, you simply put the appropriate value into the table_no field with a pre-query trigger.

If you want to update or insert things, then you'll have to write your own code to do that.

--
  _________________________   _________________________
 /  Tommy Wareing          \ /                         \
|  p0070621_at_brookes.ac.uk   X   'Bugger!' said Piglet   |
 \  0865-483389            / \                         /
  ~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
Received on Sun Nov 07 1993 - 12:52:53 CET

Original text of this message