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
0
votes
2 answers

SOCI Cannot prepare statement

I have a function like this: CREATE OR REPLACE FUNCTION get_path_set_1(IN pathset_id_in character varying, OUT id character varying, OUT pathset_id character varying, OUT utility double precision) RETURNS SETOF record AS $BODY$ begin …
rahman
  • 4,820
  • 16
  • 52
  • 86
0
votes
1 answer

Fixing lib compatibility c++ mingw and postgresql

I am trying to use postgresql together with SOCI, building their libs with MinGW. I ran into the following problem. PostgreSQL defines this strcuture @ pthread.h: #ifndef HAVE_STRUCT_TIMESPEC #define HAVE_STRUCT_TIMESPEC 1 struct timespec { long…
RafaelTSCS
  • 1,234
  • 2
  • 15
  • 36
0
votes
2 answers

MsgPack Woes - Destructor, pack_raw_body, Etc

I am using MsgPack as part of a custom back-end I am creating for the SOCI C++ database access API. Initially, some of my SOCI classes had MsgPack::sbuffer objects as member variables, but I ran into some problems in the destructor of my SOCI object…
Dan Forbes
  • 2,734
  • 3
  • 30
  • 60
0
votes
1 answer

Problems with SOCI

I'm trying to use the SOCI library for easy MySQL access but I'm stuck at installing the library. What I've done so far is : Made the project and compiled it with CMake Linked my project to the lib/release directoy that's created after…
Hatted Rooster
  • 35,759
  • 6
  • 62
  • 122
0
votes
1 answer

OCI (Oracle Call Interface) linkage errors - visual studio 2012

I'm trying to compile SOCI (http://soci.sourceforge.net/) which use OCI (Oracle Call Interface) under windows. Details: Visual studio 2012, Oracle version 11.2.0; 64 bit I found $(ORCALE_HOME)/OCI/LIB/MSVC libraries. But it won't like (I tried both…
Guy L
  • 2,824
  • 2
  • 27
  • 37
0
votes
1 answer

soci: return primary key after "insert into"

Im using soci with C++ to access my database. Is it possible to modify the following expression in a way to get the new primary key that was given to the row which is added by that expression? *dbSession << "insert into myTable(myRow) values…
Anonymous
  • 4,617
  • 9
  • 48
  • 61
0
votes
2 answers

Get rows from table using SOCI with soci::indicators [C++]

I want to get rows from my table called 'person'. I would like to do it with help of indicators in order to avoid an exception when the person has no firstname. How to do this? I wrote the code: try { soci::statement st = (sql.prepare << "SELECT…
Brian Brown
  • 3,873
  • 16
  • 48
  • 79
0
votes
1 answer

How to get a whole row from database using SOCI?

... and save it into self-defined object type? I'm using PostgreSQL. When I have everything in one file, it works. But I wanted to split this into class-files like you always do when writing in cpp. When I divided my code into *.h and *.cpp files,…
Brian Brown
  • 3,873
  • 16
  • 48
  • 79
0
votes
1 answer

Using SOCI with Qt = how to write a good *.pro file?

I would like to write a GUI app using Qt and SOCI. How to write a good *.pro file to compile a project with no errors? I wrote this: QT += core gui TARGET = example-project TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp HEADERS…
Brian Brown
  • 3,873
  • 16
  • 48
  • 79
0
votes
2 answers

How to code for SELECT * with SOCI?

In most examples for SOCI, the caller must know the fields and types in a query and specifies them through a soci::rowset<> of boost::tuple<> or through some other means. Is there a way to code without knowing the types and number of columns…
kfmfe04
  • 14,936
  • 14
  • 74
  • 140
0
votes
2 answers

How to convert wchar_t (or wchar_t* or CORBA::WChar*) to string?

In my app I have to use CORBA::WChar* (or equivalent wchar_t*) but my program also needs to save some information to the PostgreSQL database. To insert data to PostgreSQL in C++ I use SOCI. And there's the problem because : The following types are…
Brian Brown
  • 3,873
  • 16
  • 48
  • 79
0
votes
1 answer

SOCI C++ (SQL wrapper) FATAL: database "testDB" does not exist

Just another problem with Soci... I want to connect with my testDB which I've just created but the code below shows fatal error. I did this: On PostgreSQL: 1) CREATE USER robert WITH ENCRYPTED PASSWORD 'pass'; 2) CREATE DATABASE testDB; 3) GRANT…
Brian Brown
  • 3,873
  • 16
  • 48
  • 79
0
votes
1 answer

SOCI (SQL C++ wrapper) - PostgreSQL doesn't execute commands (?)

When i figured out how to compile a simple program, now I have other problem ... I installed PostgreSQL and created database and table: 1) createdb testDB 2) create table cities (city varchar(80), location varchar(80)); And my still very simple…
Brian Brown
  • 3,873
  • 16
  • 48
  • 79
0
votes
1 answer

Soci as a static library on linux/ubuntu?

I need to link a program statically with soci for security reasons. I built the static libraries libsoci_core.a and libsoci_postgresql.a as my backend is postgresql. My issue is that when I build my program with these libraries I get link…
unludo
  • 4,912
  • 7
  • 47
  • 71
1 2 3 4 5 6
7