MySQL Forums
Forum List  »  Connector/C++

Ineffective Prepared Delete Statement
Posted by: Andrew Lawrence
Date: August 26, 2016 01:08AM

I'm attempting to execute a prepared delete statement like so:

prep_stmt = conn->prepareStatement("DELETE FROM my_table WHERE my_column = ?");

sql::SQLString test_string = "\'asdf\'";

prep_stmt->setString(1, test_string);

int update_count = prep_stmt->executeUpdate();

There appears to be no runtime errors (at least, no exception is thrown). However, update_count is zero, and investigating the contents of the database after execution reveals that the associated data entry was not removed.

Has anyone seen this before?

Options: ReplyQuote

Written By
Ineffective Prepared Delete Statement
August 26, 2016 01:08AM

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.