Re: How do you convert PostgreSQL internal binary field to C datatypes

Поиск
Список
Период
Сортировка
От Jeroen T. Vermeulen
Тема Re: How do you convert PostgreSQL internal binary field to C datatypes
Дата
Msg-id 23494.125.24.219.252.1179948931.squirrel@webmail.xs4all.nl
обсуждение исходный текст
Ответ на Re: How do you convert PostgreSQL internal binary field to C datatypes  (Jeff Lynn <jmlynn@rogers.com>)
Список pgsql-interfaces
On Wed, May 23, 2007 22:47, Jeff Lynn wrote:

> So I gave up.   I will not use PostgreSQL until there is a simple way to
> extract data directly into C or C++ data type.  Is one expect to fetch
> data in text, then use text to int, text to double, text to date
> function before you can make any business logic works?

If you're working in C++ (as opposed to C, which I for one thought you
were using) then it's really easy.  As one example of the C++ API, if you
have a result set "data" and you want to extract an integer value at row
r, column c:
 int x = data[r][c].as<int>();

See http://pqxx.org/ for more on the C++ API.


Jeroen




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

Предыдущее
От: Reid Thompson
Дата:
Сообщение: Re: How do you convert PostgreSQL internal binary field to C datatypes
Следующее
От: Andrew McNamara
Дата:
Сообщение: Re: How do you convert PostgreSQL internal binary field to C datatypes