From: S.F. Lee <sflee_tw@yahoo.com>
To: Michael Meskes <meskes@postgreSQL.org>
Cc: pgsql-interfaces@postgreSQL.org
Subject: Re: [INTERFACES] manipulate array wiht ecpg
Date: Tue, 28 Dec 1999 22:40:52 -0800 (PST)
Message-ID: <19991229064052.14930.rocketmail@web221.mail.yahoo.com> (raw)
I have solved the problem by mapping a character array
into integer array:
struct data {
int id;
char a[100];
} temp;
After getting temp from exec sql select ....., I use
strtol() to convert temp.a into a integer array, and
it works! I now have another problem that is I can get
the tuples by sqlca.sqlerrd[2], but how can I get the
type of each field that has been selected? In libpq++
FieldType(n) can get the type of field, how about in
ecpg?
Thanks
S.F.Lee
--- Michael Meskes <meskes@postgreSQL.org> wrote:
> On Mon, Dec 27, 1999 at 01:51:39AM -0800, S.F. Lee
> wrote:
> > I am using ecpg to manipulate the whole row in
> a
> > table,and I have a problem in array, can anybody
> give
> > me a hint or a small test program to process
> array?
>
> Unfortunately this is a known bug in ecpg. It's
> listed on the TODO list.
> However, I have no idea so far how to fix it. The
> only way you can insert an
> array is by listing its members. That is you have to
> create your insert
> statement via sprintf for instance and use exec sql
> execute immediate.
>
> Sorry. I will fix it as soon as I find a solution.
>
> The problem is that ecpg also allows inserting the
> whole array as single
> integers by only listing the array.
>
> Michael
> --
> Michael Meskes | Go SF
> 49ers!
> Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein
> Fire!
> Tel.: (+49) 2431/72651 | Use Debian
> GNU/Linux!
> Email: Michael@Fam-Meskes.De | Use
> PostgreSQL!
>
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://messenger.yahoo.com
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: sflee_tw@yahoo.com, meskes@postgreSQL.org
Subject: Re: [INTERFACES] manipulate array wiht ecpg
In-Reply-To: <19991229064052.14930.rocketmail@web221.mail.yahoo.com>
* 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