Problem with interface C++ for PostgreSQL - Mailing list pgsql-general

From Renaud Tthonnart
Subject Problem with interface C++ for PostgreSQL
Date
Msg-id 3AB8BB57.2C6E58BF@amwdb.u-strasbg.fr
Whole thread Raw
Responses Re: Problem with interface C++ for PostgreSQL
List 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 by date:

Previous
From: John Madden
Date:
Subject: Re: Really Dumb Question...(Dumping db)
Next
From: Culley Harrelson
Date:
Subject: Implementing cascading deletes on an existing table