Questions tagged [soci]

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.

104 questions
29
votes
2 answers

C++ SQL database library comparison

I am starting development on a medium-scale C++ project that has to work with a Microsoft SQL Server database. I have done database work before using .NET technologies but I don't find using a .NET approach to be appropriate this time. I would like…
El Weon
  • 385
  • 1
  • 3
  • 12
16
votes
1 answer

Differences between OTL and SOCI

What are the advantages and disadvantages of the C++ database libraries OTL and SOCI? In particular, what differences are relevant for my project, whose database uses SQL Server 2008? I haven't used either before, and during my project I don't want…
ikhtiyor
  • 504
  • 5
  • 15
9
votes
2 answers

How to use SOCI C++ Database library?

I'm trying to implement soci in my program but I don't know how. I'm using C++ on Linux, on a project using netbeans. I have followed the steps in: http://soci.sourceforge.net/doc/structure.html to install it, and I tried to copy the files soci.h…
NeDark
  • 1,212
  • 7
  • 23
  • 36
8
votes
1 answer

C++ SOCI query into vector of custom Object

Currently I'm writing a C++ application where I have to connect to a SQLite database. I search for a library and found SOCI and I have to say: I love it. The stream syntax and the mapping is so awesome. But I have one problem with it: I have an…
Cilenco
  • 6,951
  • 17
  • 72
  • 152
7
votes
2 answers

How do you properly install SOCI?

I'm facing an annoying problem that has been holding me back from programming for some time. I intend to start a personal project in which I need to use a database to store certain information and I decided to use SQLite however I did not like the…
Mihai Bişog
  • 998
  • 9
  • 24
6
votes
2 answers

Preventing SQL injection in C++ OTL, DTL, or SOCI libraries

I've been looking at all three of these database libraries, and I'm wondering if they do anything to prevent SQL injection. I'm most likely going to be building a lib on top of one of them, and injection is a top concern I have in picking one. …
Brett Rossier
  • 3,420
  • 3
  • 27
  • 36
5
votes
1 answer

How do I bind a variable to a prepared statement with the SOCI libary?

Currently my application only supports SQLite databases, but I would like to support both SQLite and MySQL databases, so I'm testing out the SOCI library to see if it does what I need. However, despite the examples and documentation, I can't figure…
x-x
  • 7,287
  • 9
  • 51
  • 78
5
votes
1 answer

How to get a whole row from database using SOCI into user-defined object type?

I extended my class (from this question: How to get a whole row from database using SOCI?) to have two private members, also added getters and setters. But when compiling my program, I have errors again. myClass.h #include #include…
Brian Brown
  • 3,873
  • 16
  • 48
  • 79
4
votes
1 answer

Undefined symbol error with -static-libasan

I use address sanitizer to sanitize my application, Which is linked with SOCI. But that prompt followijg error message while using with Oracle. ./SociUT: symbol lookup error: /home/testhome/libs/libsoci_oracle.d.so.1.4.18: undefined symbol:…
Janaka
  • 489
  • 1
  • 4
  • 23
4
votes
1 answer

Calling PLsql script with an anonymous PL SQL block from SOCI

I'm searching for a way to call an anonymous PLsql block through SOCI. The data transfer takes place through a refcursor that was previously created as a variable in the script: variable rc refcursor declare v_obj_id number(4,0) := 1; …
Sampath
  • 1,144
  • 1
  • 21
  • 38
4
votes
1 answer

How to avoid SOCI Error: Null value fetched and no indicator defined

I'm getting the "Error: Null value fetched and no indicator defined" when my application fetches the data from Oracle using SOCI. How I can avoid it? try { statement st = (sql.prepare << "SELECT COLUMN1, COLUMN2, COLUMN3,…
Sujith Gunawardhane
  • 1,251
  • 1
  • 10
  • 24
4
votes
0 answers

SOCI MySQL problems on OS X

My project is trying to incorporate SOCI for easy MySQL database access from C++. One of my teammates created a running SOCI test program in linux using the MySQL backend with only this link in his CMake file: target_link_libraries(MyExecutable…
kelano
  • 293
  • 3
  • 14
3
votes
1 answer

Is it possible to manage table relationships with SOCI c++ database access library

Let say I have two tables with a many-to-many relationship (i.e. there is a 3rd table only used for the relationship). Does SOCI support the different types of 'join' in the statements? If yes, does it work with all the databases (so called backends…
unludo
  • 4,912
  • 7
  • 47
  • 71
3
votes
0 answers

Why can't I catch the soci::mysql_soci_error exception?

This is my code. #include #include #include #include #include #include #include #include #include using namespace…
lxc
  • 67
  • 9
3
votes
0 answers

Linking error with soci-postgresql

I followed following steps to build soci with postgresql and build my application with soci. 1) Checkout code from git in to directory /home/sujith/soci/src sujith@sujith-VirtualBox:~/soci/src$…
Sujith Gunawardhane
  • 1,251
  • 1
  • 10
  • 24
1
2 3 4 5 6 7