I am using soci 3.2.3 on Windows compiled with TDM-GCC..  It works
well except when I try to write NULL values.

I have the following statement instatiation which will not compile

    statement statusInsert= (pgDB.prepare << sqlStatusInsert,

        use(status.equip), use(status.serial), use(status.customer),
use(status.city), use(status.prov), use(status.country),
use(status.status),

        use(date2tm(status.rma_issued), status.rma_issued   ? i_ok : i_null),

        use(date2tm(status.rcvd),       status.rcvd         ? i_ok : i_null),

        use(date2tm(status.rfqc),       status.rfqc         ? i_ok : i_null),

        use(date2tm(status.done),       status.done         ? i_ok : i_null),

        use(date2tm(status.ship),       status.ship         ? i_ok : i_null),

        use(status.workdays),

        use(status.rma_number), use(status.rma_sequence),
use(status.special), use(status.estimate), use(status.tech),
use(status.notes)

        );

It gives me compile errors like this

C:\Users\MSurette\Documents\SpiderOak
Hive\code\DOERS\statusSync\statusSync.cpp:293: error: no matching
function for call to 'use(tm, soci::indicator)'
         use(date2tm(status.rma_issued), status.rma_issued ? i_ok : i_null),
                                                                          ^
sqlStatusInsert is a const char * to the sql INSERT statement.
date2tm takes a Date which is really a long, and converts it to a
std::struct tm.

If I use the single argument version of use() it works fine.

Any advice on how I could set these NULL values conditionally?

-- 
Mike

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
soci-users mailing list
soci-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to