Quantcast
Channel: MySQL Forums - Connector/C++
Viewing all articles
Browse latest Browse all 527

Proper way of using expr in complicated queries (no replies)

$
0
0
Trying to create the following query in Connector/C++ 8 (xDevAPI):
SELECT * FROM table
WHERE column1 IS NULL OR (column2 is NULL AND DATE_SUB(NOW(), INTERVAL 10 SECOND) > column1);

Not sure how to go about this WHERE part in code. Wrapping everything in expr() throws an error: CDK Error: After seeing '...IS NULL OR (column2 is NULL AND DATE_SUB(NOW(), INTERVAL ', looking at '10 SEC...': Expected ')' to close function argument list (cdk:8)

What is a proper way? Also will it work if I parametrize 10 with :timeout and then bind("timeout", 10)?

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>