ECPG Questions

From: Jim Parker <hopeye(at)cfl(dot)rr(dot)com>
To: "PostgreSQL mailing list" <pgsql-interfaces(at)postgresql(dot)org>
Subject: ECPG Questions
Date: 2002-07-11 15:01:27
Message-ID: 200207111501.g6BF1Ro0011306@smtp-server1.tampabay.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Oliver Elphick 2002-07-11 15:23:31 Re: cann't find libs to run pgaccess ....
Previous Message Andres Ledesma 2002-07-11 14:12:12 cann't find libs to run pgaccess ....