Re: append a table onto the end of another

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 18 Feb 2004 07:09:15 -0800
Message-ID: <2687bb95.0402180709.60a2812c_at_posting.google.com>


jsa1981_at_hotmail.com (Jagdip Singh Ajimal) wrote in message news:<c84eb1b0.0402180225.2f8071d0_at_posting.google.com>...
> I have two tables, appointments and backupappointments.
> I also have a
> function getAppointments(theDate DATE) RETURN RECORDSET
> (which has not been written yet).
> What I want the function to do is take a date, and return a table of
> appointments on that date. My problem has two parts:
>
> 1) How do I append the table backupappointments to the table
> appointments so that I can do a simple SELECT on the date of this new
> table?
>
> 2) How do I return the filtered table?
>
> Any help would be greatly appriciated
>
> Jagdip Singh Ajimal

If you can write a select to get the records from each table then you can add a UNION to combine the two selects into one SQL statement, perhaps a view. You could then query the view/UNION statement to get your result set.

You have many options on how you return the record set depending on what you want to do with it.

See the Concepts manual for an explantion of Views and the SQL manual for CREATE VIEW and UNION.

HTH -- Mark D Powell -- Received on Wed Feb 18 2004 - 16:09:15 CET

Original text of this message