PGSQL insert data to a oid column using SOCI

From: Chamath Sajeewa <csgsajeewa(at)gmail(dot)com>
To: pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: PGSQL insert data to a oid column using SOCI
Date: 2020-07-29 18:16:53
Message-ID: CACpofeiM9ZEWRLApx=hTV0KkpJFqNgckYOn2iCB-UbNMmk_T+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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*(200) *NULL*,

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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message David Raymond 2020-07-29 19:01:29 RE: PGSQL insert data to a oid column using SOCI
Previous Message Stephen Frost 2020-07-29 14:45:27 Re: Will crashed transaction be rollbacked?