pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Meskes <meskes@postgresql.org>
To: Jim Parker <hopeye@cfl.rr.com>
Cc: PostgreSQL mailing list <pgsql-interfaces@postgresql.org>
Subject: Re: ECPG Questions
Date: Fri, 12 Jul 2002 15:58:04 +0200
Message-ID: <20020712135804.GQ6147@feivel.credativ.de> (raw)
In-Reply-To: <200207111501.g6BF1Ro0011306@smtp-server1.tampabay.rr.com>
References: <200207111501.g6BF1Ro0011306@smtp-server1.tampabay.rr.com>

On Thu, Jul 11, 2002 at 11:01:27AM -0400, Jim Parker wrote:
> 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.

The data points are not stored as one attribute of array type, but
rather as several tuples?

> 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.

You can use an empty pointer to that array, libecpg will allocate the
memory if you fill the array at once. No need to use a cursor.

Michael
-- 
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!



view thread (4+ messages)  latest in thread

Message-ID: <20020712135804.GQ6147@feivel.credativ.de>
Permalink:  ../20020712135804.GQ6147@feivel.credativ.de/
Also on:    postgresql.org/message-id/20020712135804.GQ6147@feivel.credativ.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: meskes@postgresql.org, hopeye@cfl.rr.com
  Subject: Re: ECPG Questions
  In-Reply-To: <20020712135804.GQ6147@feivel.credativ.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox