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

Binding NULL in a prepared statement (no replies)

$
0
0
Hello,

I'm trying to bind NULL for a nullable datetime column using a prepared statement as follows -

session.sql("UPDATE `table` SET `datetime` = ? WHERE `id` = 1").bind(NULL).execute();

This crashes.

Passing null as string gives the following error - "Invalid value for datetime column: 'null'"

How do I achieve this?

Viewing all articles
Browse latest Browse all 527

Trending Articles



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