Skip to content

Can't reuse Poco::Data::Statement with a new set of bindings #3165

@db4

Description

@db4

I'm trying to reuse the same statement with different bindings. Surprisingly it does not work:

Session session(...);
Statement statement(session);
statement << "INSERT INTO test(f1) VALUES(?)";
statement.addBind(Poco::Data::Keywords::bind(1, "f1"));
statement.execute(); //OK
statement.removeBind("f1");
statement.addBind(Poco::Data::Keywords::bind(2, "f1"));
statement.execute(); // Assertion violation: !pBinder.isNull() [in file "D:\.conan\data\poco\1.10.1\_\_\package\79d47f014080a953179622161c373e018e32729f\include\Poco/Data/Binding.h", line 171]

This happens for SQLite, but I don't think it's database-specific. Am I just missing something?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions