Problem with interface C++ for PostgreSQL

From: Renaud Tthonnart <thonnart(at)amwdb(dot)u-strasbg(dot)fr>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Problem with interface C++ for PostgreSQL
Date: 2001-03-21 14:31:51
Message-ID: 3AB8BB57.2C6E58BF@amwdb.u-strasbg.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Culley Harrelson 2001-03-21 14:42:17 Implementing cascading deletes on an existing table
Previous Message John Madden 2001-03-21 14:15:27 Re: Really Dumb Question...(Dumping db)