Re: PGSQL insert data to a oid column using SOCI - Mailing list pgsql-novice

From Chamath Sajeewa
Subject Re: PGSQL insert data to a oid column using SOCI
Date
Msg-id CACpofejDZiQp5qLJn-wg=n3uoDqs1yPqMCNxDJxJA2rD-4Yjdw@mail.gmail.com
Whole thread Raw
In response to RE: PGSQL insert data to a oid column using SOCI  (David Raymond <David.Raymond@tomtom.com>)
Responses Re: PGSQL insert data to a oid column using SOCI  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-novice
What is the correct data type to be used for large objects then?

On Thu, 30 Jul 2020, 00:31 David Raymond, <David.Raymond@tomtom.com> wrote:

https://www.postgresql.org/docs/current/datatype-oid.html

 

Are you sure OID is what you really want? An OID is basically an integer. Not something you can store text or xml data into.

 

 

From: Chamath Sajeewa <csgsajeewa@gmail.com>
Sent: Wednesday, July 29, 2020 2:17 PM
To: pgsql-novice@lists.postgresql.org
Subject: PGSQL insert data to a oid column using SOCI

 

Hi All,

I am using c++ with soci to insert oid values to a table.

 

Table structure is as follows,

 

CREATE TABLE test_table (

       key varchar(200NULL,

       value oid NULL

);

 

Value is a large xml file given as std::string.

What is the correct way to insert oid data using binding variables.

Used code snippet is given below which is not working.

 

std::string key = "test key";

std::string value = "test xml";

std::string sql = "insert into test_table(key,value) values (:KEY, :VALUE)

soci:use(key);

soci:use(value);

 

soci::statement st(session);

st.prepare(sql)

st.execute()

 

Thanks!

 


 

--

G.K.M.C Sajeewa

 

pgsql-novice by date:

Previous
From: David Raymond
Date:
Subject: RE: PGSQL insert data to a oid column using SOCI
Next
From: "David G. Johnston"
Date:
Subject: Re: PGSQL insert data to a oid column using SOCI