array in a store procedure in C

From: Juan Pablo L <jpablolorenzetti(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: array in a store procedure in C
Date: 2015-01-29 14:45:42
Message-ID: CABSYDaaLTw61Mvn-Pwzng_Y3N8qL=VpwKyFMi56HFtWT38QLyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, i m developing a store procedure that accepts an array of rows, this is
the simplified code:

http://pastebin.com/wC92Dh7f

Please note that i left out everything that is not related, in the
function, to the problem at hand, only the code related to my problem is
included.

The above does not allow me to access the members of the rows in the array,
this is how i call this function:

select ret,username,password from
wtt_add_account('2802021','JPL123','1','3',ARRAY[row('1','25','10')::wtt_balance_info_t,row('2','50','15')::wtt_balance_info_t]);

The type wtt_balance_info_t is:

CREATE TYPE wtt_balance_info_t AS (balanceid varchar(25),chgval
varchar(25),servicestop varchar(25)) .

I would really appreciate if someone could give me guidelines how to
read/extract the rows from the array and then get each element from the
rows. thank you very much!!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Day, David 2015-01-29 14:54:23 Re: segmentation fault postgres 9.3.5 core dump perlu related ?
Previous Message Kevin Grittner 2015-01-29 14:33:55 Re: How does Delete Query work ??