Re: ECPG Questions

Поиск
Список
Период
Сортировка
От Michael Meskes
Тема Re: ECPG Questions
Дата
Msg-id 20020712135804.GQ6147@feivel.credativ.de
обсуждение исходный текст
Ответ на ECPG Questions  (Jim Parker <hopeye@cfl.rr.com>)
Ответы Re: ECPG Questions
Список pgsql-interfaces
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!


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: "Warren W. Gay VE3WWG"
Дата:
Сообщение: Re: Wish List: Client access to NUMERIC/DECIMAL type functions
Следующее
От: Alexaki Sofia
Дата:
Сообщение: Re: arrays as input parameter for c functions