append a table onto the end of another

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jagdip Singh Ajimal

    append a table onto the end of another

    I have two tables, appointments and backupappointme nts.
    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 backupappointme nts 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
  • Mark C. Stock

    #2
    Re: append a table onto the end of another


    "Jagdip Singh Ajimal" <jsa1981@hotmai l.comwrote in message
    news:c84eb1b0.0 402180225.2f807 1d0@posting.goo gle.com...
    | I have two tables, appointments and backupappointme nts.
    | 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 backupappointme nts 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



    Comment

    • Mark D Powell

      #3
      Re: append a table onto the end of another

      jsa1981@hotmail .com (Jagdip Singh Ajimal) wrote in message news:<c84eb1b0. 0402180225.2f80 71d0@posting.go ogle.com>...
      I have two tables, appointments and backupappointme nts.
      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 backupappointme nts 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 --

      Comment

      • Seamus Ma' Cleriec

        #4
        Re: append a table onto the end of another

        jsa1981@hotmail .com (Jagdip Singh Ajimal) wrote in message news:<c84eb1b0. 0402180225.2f80 71d0@posting.go ogle.com>...
        I have two tables, appointments and backupappointme nts.
        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 backupappointme nts 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.

        Comment

        Working...