Subject: Simple query

From: [email-masked]
Date: Wed, 15 Sep 1993 13:29 +1300

Hi,

I am trying to write a postquel function that returns all of an invoices 
header and the corresponding lines.

I have written a postquel function such that

  define function get_invoice
    (langauge = "postquel", returntype = setof inv_details)
     arg is (invoice)
     as "retrieve (inv_detail.all)
     where $1.inv_no = inv_details.inv_no"
  \g

I then do a query

  * retrieve (invoice.inv_no, invoice.cust_no
              details = invoice.get_details.inv_no)
              where invoice.inv_no = "XXXXX" \g

The only problem with this is that it only returns the invoice number from
the inv_details file.  It does not also all me to get
              details = invoice.get_details.all

My data structure are set up as

create invoice(inv_no = char16, cust_no = char16, ...)

create inv_details (inv_no = char16, prod_no = char16, quantity = int4)

  If there is any way to do this (other than as a straight postquel query)
  with a function, could someone please let me know.

  Thankyou for your thoughts

Alistair Ashcroft
Infos
[email-masked]
New Zealand