Skip to content

[SQLite] Should running a parameterized update statement with execute be possible? #596

Closed
@margaretselzer

Description

@margaretselzer

I have the following update statement:

auto u =
    sqlpp::update(t)
        .set(t.checksum = sqlpp::parameter(t.checksum))
        .where(sqlpp::verbatim<sqlpp::unsigned_integral>("ROWID")
               == sqlpp::parameter(sqlpp::unsigned_integral(), sqlpp::alias::i));

auto u_stmnt = db.prepare(u);

Running this query like this: db(u_stmnt); works perfect.

However, using db.execute(u_stmnt);
results in compile time error: no matching function for call to ‘serialize(const sqlpp::prepared_update_t<sqlpp::sqlite3::connection_base, sqlpp::statement_t<void, sqlpp::update_t, sqlpp::single_table_t<void, MyTable>, sqlpp::update_list_t<void, sqlpp::assignment_t<sqlpp::column_t<MyTable, MyTable_::field_checksum>, sqlpp::parameter_t<sqlpp::unsigned_integral, sqlpp::column_t<MyTable, MyTable_::field_checksum> > > >, sqlpp::where_t<void, sqlpp::binary_expression_t<sqlpp::verbatim_t<sqlpp::unsigned_integral>, sqlpp::op::equal_to, sqlpp::parameter_t<sqlpp::unsigned_integral, sqlpp::alias::i_t> > > > >&, sqlpp::sqlite3::connection_base::_context_t&)’

Now, as I am running an update I really do not need any kind of result back so my gut tells me that this should work with execute(), but it does not.

Is my gut talking nonsense or - against all odds - it does have a point?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions