ECPG Questions - Mailing list pgsql-interfaces

From Jim Parker
Subject ECPG Questions
Date
Msg-id 200207111501.g6BF1Ro0011306@smtp-server1.tampabay.rr.com
Whole thread Raw
Responses Re: ECPG Questions
List 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



pgsql-interfaces by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: Re: [HACKERS] bugzilla.pgaccess.org
Next
From: "Warren W. Gay VE3WWG"
Date:
Subject: Wish List: Client access to NUMERIC/DECIMAL type functions