Skip to content

not able to execute multiple queries at a time #62

Open
@gopikrishnaParisa

Description

@gopikrishnaParisa

hi,
i was trying to execute INSERT and DELETE in a single command, but i couldn't do it using Sqlite3pp.
sample code:

query = "INSERT INTO Logs (logData) VALUES(?);"
"DELETE FROM Logs WHERE sequenceId=(SELECT MIN(sequenceId) FROM Logs)";
sqlite3pp::command cmd(clinicalDb_, query.c_str());
cmd.bind(1, (void *)&info, sizeof(info), sqlite3pp::copy);

     if ((rc = cmd.execute_all()) != NO_SQL_ERROR)
     {
        PX_ERRORF("Command Execution failed. rc = {}", rc);
     }

in this case i am getting rc value 1(SQLITE_ERROR).

if i pass some string to VALUES("some string), query executes successfully.

Please help me how to solve this.

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