Received: from linbicos.bicos.de (linbicos.bicos.de [194.162.32.1]) by hub.org (8.9.3/8.9.3) with ESMTP id SAA64143 for ; Fri, 14 May 1999 18:33:50 -0400 (EDT) (envelope-from lewerken@mail.bicos.de) Received: from gateway.lewerkenedv.de (root@lewerk.bicos.de [194.162.35.117]) by linbicos.bicos.de (8.9.3/8.9.3) with ESMTP id XAA04330 for ; Fri, 14 May 1999 23:06:52 +0200 X-NCC-RegID: de.bicos Received: from sgi320 ([10.0.0.7]) by gateway.lewerkenedv.de (8.8.8/8.8.8) with SMTP id BAA24502 for ; Sat, 15 May 1999 01:29:47 +0200 Message-ID: <000f01be9e4d$d7cc1860$0700000a@sgi320.lewerkenedv.de> From: "Alf Lewerken" To: Subject: libpq++ and arrays? Date: Fri, 14 May 1999 23:07:56 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000C_01BE9E5E.9A561600" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 This is a multi-part message in MIME format. ------=_NextPart_000_000C_01BE9E5E.9A561600 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all I have the following problem: I'm using libpq++ to acces a Postgres-Database. The table was created in psql using: create table test values (nr int4, some_value float4[]); in my C++-program a piece of code is: main() { char *nr_string, *some_other_string; PgDatabase test(pgenv, "test"); test.Exec("begin"); test.Exec("declare c cursor for select * from test"); =20 for(int i=3D0; i
Hi all
 
I have the following problem:
I'm using libpq++ to acces a = Postgres-Database.
 
The table was created in psql using:
create table test values (nr int4, some_value=20 float4[]);
 
in my C++-program a piece of code=20 is:
 
main()
{
  char *nr_string,=20 *some_other_string;
 
  PgDatabase test(pgenv,=20 "test");
 =20 test.Exec("begin");
  test.Exec("declare c = cursor for=20 select * from test");
 
  for(int i=3D0;=20 i<test.Tuples();i++)
  {
     nr_string = =3D=20 test.GetValue(i, "nr");  // obtaining the value in 'nr' = is=20 easy
 
     = some_other_string =3D=20 test.GetValue(i, "some_value[1]"); // this gives an = error
     //=20 PQgetvalue: ERROR! field number -1 is out of range
  
     // so how = do I obtain=20 values in some_value[1], some_value[2] .... ?
  }
}
 
any help would be = appreciated.
 
 
bye
 
 
Alf = Lewerken
------=_NextPart_000_000C_01BE9E5E.9A561600--