On 23 September 2015 at 18:03, Michael Surette <mjsure...@gmail.com> wrote:
> 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),
> [...]
>
> 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),

I'd have expected it to work, but I haven't used/tested SOCI 3.2 for ages.

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

Regardless, I have updated SOCI tests specifically with your use case
and it compiles/runs well (see Travis CI and Appveyor):
https://github.com/SOCI/soci/commit/68a335707a9177e69c184a6180b001d1a2015b50

I'd suggest to try SOCI form the current master (to be released as
4.0, timeline unknown).

Best regards,
-- 
Mateusz  Loskot, http://mateusz.loskot.net

------------------------------------------------------------------------------
_______________________________________________
soci-users mailing list
soci-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to