SOCI is a database access library for C++ that makes the illusion of embedding SQL queries in the regular C++ code, staying entirely within the Standard C++. The idea is to provide C++ programmers a way to access SQL databases in the most natural and intuitive way.
Questions tagged [soci]
104 questions
2
votes
1 answer
Issue with rowset of boost tuples with SOCI c++ database access library
I have a compilation error when using rowset of tuples with the latest soci and boost libraries.
I found an example on the net but it does not compile with the version of SOCI that I use and which is the latest.
The portion which is causing issue…

unludo
- 4,912
- 7
- 47
- 71
2
votes
1 answer
Is SQLite right for my game?
I have been looking into different database libraries for my online card game (PostgreSQL, Oracle, etc) and, while SOCI + pg or Oracle are much more powerful, they also are tricky to compile, integrate, and do a whole lot more than what I need to…

jmasterx
- 52,639
- 96
- 311
- 557
2
votes
0 answers
Cannot insert special symbols to Oracle database
I tried to add special symbols (i.e : æ_ø_å_Æ_Ø_Å_____£€$&@%¿) to Oracle database table VARCHAR2 column and different results noticed in following methods.
Database character set : SELECT * FROM nls_database_parameters WHERE parameter LIKE…

ShaL
- 141
- 6
2
votes
1 answer
How to handle minus operator with SOCI library?
I need to use SOCI library to handle minus operator in a database agnostic way.
Oracle keyword 'MINUS' does not support in postgres and respective postgres keyword is 'EXCEPT' .
Ex : Oracle Syntax
SELECT COUNT(*) FROM (SELECT C1 FROM s1.T1 **MINUS**…

ShaL
- 141
- 6
2
votes
2 answers
How to properly install SOCI c++ library on windows 10?
I want to do database coding in c++. What modern C++ libraries should be in my toolbox? shows that SOCI is a good library which is cross-platform and free. But the installation of SOCI is a big issue, since I can't find a good blog or tutorial or…

Va_M
- 522
- 2
- 5
- 18
2
votes
1 answer
How can I get the schema or row names of a table in soci?
I am trying to accomplish this, and I know how to do it indirectly...if I can get the schema of a table.
How can I do this using soci?
I have tried:
std::string i;
soci::statement st = (mSql->prepare <<
"show create table tab;",
…
user7537486
2
votes
1 answer
Need help connecting MSSQL via Soci
Today I was thought of creating a C++ app that connects to MS SQL server and do functions such as retrieving records and execute SPROCs, Then I found this Soci, a C++ library which helps our app to talk with DB, and I also found there is no specific…

RaGa__M
- 2,550
- 1
- 23
- 44
2
votes
0 answers
How can I read PostgreSQL arrays with SOCI?
I need to execute some query that returns (SELECTs) a PostgreSQL array, but the documentation of SOCI's PostgreSQL backend doesn't mention anything about arrays.
If I just try to put it into a soci::rowset, it thinks that it is a string column and…

Yodan Tauber
- 3,907
- 2
- 27
- 48
2
votes
1 answer
SQL Server Stored Procedure via SOCI/ODBC in C++
I am using the SOCI library to programmatically interact with a SQL Server DB via ODBC. I am having trouble getting values via output parameters in stored procedures. Some code (modeled after SOCI documentation)...
/*
* create procedure
*…

Dan Forbes
- 2,734
- 3
- 30
- 60
2
votes
1 answer
Soci C++ sqlite3 backend abstract on build
I'm facing an issue building an application with SOCI C++ 3.2 with mysql and sqlite3 backends. Here are the headers I included:
#include
#include
#include
#include
Here is the building…

Syffys
- 570
- 5
- 21
2
votes
2 answers
Bad cast while getting data from PostgreSQL database using SOCI
I have a database in PostgreSQL. And I have sql query (which btw works great in PostgreSQL, so the sql code isn't wrong):
SELECT COUNT(*) as size, creation_date FROM item INNER JOIN raf_item USING (id) INNER JOIN item_detail USING (id) GROUP BY…

Brian Brown
- 3,873
- 16
- 48
- 79
1
vote
2 answers
How do convert a block unsigned char* memory to a block of [signed] char* memory?
I'm working on an iPad project (iOS 5.1) which requires fetching images from a url and caching them as a sqlite3 blob. I'm using ASIHTTPRequest to fetch the image data and SOCI to insert the blob into the cache table. The project is written in C++…

aleroy
- 45
- 6
1
vote
0 answers
How to bulk insert with std::vector of custom object in soci?
I have seen this but how to insert a set of custom objects of std::vector into a database using the soci database library
For example, take the c++ class representing a table,
struct one_min_equity {
int64_t id;
std::string timestamp;
double…

srilakshmikanthanp
- 2,231
- 1
- 8
- 25
1
vote
1 answer
(10210) Attribute identifier invalid or not supported
We are running snowflake ODBC driver on Linux and connect using soci ODBC but getting following error .Any idea how to resolve this ?
2022-01-05T05:07:26.539 TRACE 1954 Simba::Snowflake::SFConnection::SFConnection: +++++ enter +++++
…

JLT
- 46
- 6
1
vote
1 answer
soci gives fatal error: mysql.h: No such file or directory
When I am trying to compile a program that is using SOCI library I get:
/usr/local/include/soci/mysql/soci-mysql.h:31:10: fatal error: mysql.h: No such file or directory
I've checked and I have mysql.h in:
/usr/include/mysql
My CMakeLists file…

Robert-Nicolae Solca
- 73
- 2
- 7