[odb-users] (no subject)

Евгений Демьянов demianov314 at yandex.ru
Tue Jul 8 10:29:11 EDT 2014


I using odb-3.2.0 with Microsoft SQL Server. I try to execute stored procedure using the folowing statement

#pragma db view
struct ProcResult
{
    int Result;
    std::string Comment;
};

// .
// .
// .

std::stringstream raw_query;
raw_query << "exec Procedure" << value1 << ", " << value2 ; 

Result r ( db.query<ProcResult> (
        raw_query.str().c_str() ) ) ;

But libodb-mssql-3.2.0 library automatically prepends "WHERE " keyword before native SQL string.

I temporary solved this problem by modifying function check_prefix in file query.cxx. I added conditions 
 s.compare (0, (n = 4), "EXEC") == 0 ||s.compare (0, (n = 4), "exec") == 0.

Is there any solution to call stored procedure without modifying the source code of ODB library?



More information about the odb-users mailing list