MySQL Forums
Forum List  »  Connector/C++

Proper way of using expr in complicated queries
Posted by: Chris Brown
Date: April 13, 2022 05:53AM

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)?

Options: ReplyQuote


Subject
Views
Written By
Posted
Proper way of using expr in complicated queries
467
April 13, 2022 05:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.