Problem with interface C++ for PostgreSQL

Поиск
Список
Период
Сортировка
От Renaud Tthonnart
Тема Problem with interface C++ for PostgreSQL
Дата
Msg-id 3AB8BB57.2C6E58BF@amwdb.u-strasbg.fr
обсуждение исходный текст
Ответы Re: Problem with interface C++ for PostgreSQL  ("Eric G. Miller" <egm2@jps.net>)
Список pgsql-general
Good afernoon everyone

I am developping an interface C++ for a DB PostgreSQL.
I am using the 'libpq++ ' library to load and save in the base.

Here is my problem :
to save some data in the base, we have to build a string (here : query)
for these functions  :

Exec(char *query) or ExecTuplesOk(char* query)

Then, if I want to save an integer in my DB, i have to do this :

sprintf(query,"INSERT INTO myTable VALUES(...,%d,...)",myInt);
myObject.ExecTupleOk(query);

With integer, it is not so bad, but with float or double, the fact to
convert data to string is very bad for precision.

Could someone tell me how to avoid using a string to save in the DB

Thank you all
regards, Renaud THONNART


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

Предыдущее
От: John Madden
Дата:
Сообщение: Re: Really Dumb Question...(Dumping db)
Следующее
От: Culley Harrelson
Дата:
Сообщение: Implementing cascading deletes on an existing table