How to handle minus operator with SOCI library?

61 Views Asked by At

I need to use SOCI library to handle minus operator in a database agnostic way. Oracle keyword 'MINUS' does not support in postgres and respective postgres keyword is 'EXCEPT' . Ex : Oracle Syntax SELECT COUNT(*) FROM (SELECT C1 FROM s1.T1 **MINUS** (SELECT C1 FROM S2.T1));

Postgres Syntax SELECT COUNT(*) FROM (SELECT C1 FROM s1.T1 **EXCEPT** (SELECT ENTITY_ID FROM C1 FROM s2.T1));

Likewise SOCI library provide a function to handle nvl ('''soci::session::nvl()'''), is there any capability to handle minus operator as well?

1

There are 1 best solutions below

0
ShaL On

Yes. SOCI library has provided a function call soci::session::except() function to fulfill this requirement.