libpq++ and arrays?

Поиск
Список
Период
Сортировка
От Alf Lewerken
Тема libpq++ and arrays?
Дата
Msg-id 000f01be9e4d$d7cc1860$0700000a@sgi320.lewerkenedv.de
обсуждение исходный текст
Ответы Re: [INTERFACES] libpq++ and arrays?  ("Patrick Welche" <prlw1@newn.cam.ac.uk>)
java and postgresql 6.5  (<yves@vlaanderen.net>)
Список pgsql-interfaces
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");
 
  for(int i=0; i<test.Tuples();i++)
  {
     nr_string = test.GetValue(i, "nr");  // obtaining the value in 'nr' is easy
 
     some_other_string = test.GetValue(i, "some_value[1]"); // this gives an error
     // PQgetvalue: ERROR! field number -1 is out of range
  
     // so how do I obtain values in some_value[1], some_value[2] .... ?
  }
}
 
any help would be appreciated.
 
 
bye
 
 
Alf Lewerken

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] 6.5 cvs: problem with includes in src/interfaces/libpq++/
Следующее
От: "Jackson, DeJuan"
Дата:
Сообщение: RE: [INTERFACES] Re: [sql] mysql vs. postgresql