Received: from smtp-server1.tampabay.rr.com (smtp-server1.tampabay.rr.com [65.32.1.34]) by postgresql.org (Postfix) with ESMTP id 322C84758F1 for ; Thu, 11 Jul 2002 11:01:23 -0400 (EDT) Received: from [192.168.0.2] (47.80.35.65.cfl.rr.com [65.35.80.47]) by smtp-server1.tampabay.rr.com (8.12.2/8.12.2) with ESMTP id g6BF1Ro0011306 for ; Thu, 11 Jul 2002 11:01:27 -0400 (EDT) Message-Id: <200207111501.g6BF1Ro0011306@smtp-server1.tampabay.rr.com> Date: Thu, 11 Jul 2002 11:01:27 -0400 From: Jim Parker To: "PostgreSQL mailing list" Subject: ECPG Questions Reply-To: hopeye@cfl.rr.com X-Mailer: Spruce 0.7.4 for X11 w/smtpio 0.8.2 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200207/67 X-Sequence-Number: 2876 G'Day ! I am writing an application that intefaces with a POstgreSQL database thru ECPG. One of my queries is rather complex involving 4+ tables. One table has an arbitrary number of items associated with a single entry on another table. It is actually a many to many relationship. I am using a "index" table to relate the two. For example: I have a table that contains an id plus other information then a second table that contains an id as a foriegn key plus an arbitray number of data points. the two table are associated with an index table. I want to retrieve the data and put it into a linked list of structs, the data points in an array inside the struct. Is there an easy way to do this. I was think that I would open a cursor to get the info from the first table (which includes a column for number of data points) Then allocate an array and open a second cursor to retrieve the data points, then put all the data into a list element and move to the next truple. Is this legal ? Is there a better way ? The alternative is to get all the data in one large truple and throw away all the repetive data returned. This seems like an unneeded headache. comments and suggestions cheers, Jim Parker