By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,197 Members | 977 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,197 IT Pros & Developers. It's quick & easy.

append a table onto the end of another

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"Jagdip Singh Ajimal" <js*****@hotmail.com> wrote in message
news:c8**************************@posting.google.c om...
| 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
lookup UNION (SQL) and REF CURSOR or pipeline functions or TABLE(CAST
(see my posts on 'example: PIPELINED function' and 'Input array string')

-- mcs

Jul 19 '05 #2

P: n/a
js*****@hotmail.com (Jagdip Singh Ajimal) wrote in message news:<c8**************************@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 --
Jul 19 '05 #3

P: n/a
js*****@hotmail.com (Jagdip Singh Ajimal) wrote in message news:<c8**************************@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

1) Create a view usin the UNION of both tables
2) return a "REF CURSOR"

details left as an exercise for the reader.
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.