-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not able to execute multiple queries at a time #62
Comments
I don't remember exactly, but the bound params are applied to each statement. The second statement, DELETE, does not need a param. |
Hi,The reason for combining both the statements is to save some time. My app used to 20-25 requests for sec. at Max.
If i run both in separate statement, it is taking around 50 msc in avg. At this speed I would be able to store 20 records only, and I may loose some records.
If I run both in single statement, the logging time is around 30-35 msec.
Thank you.
Sent from Yahoo Mail on Android
On Mon, Sep 23, 2019 at 8:09 PM, Wongoo Lee<notifications@github.com> wrote:
I don't remember exactly, but the bound params are applied to each statement. The second statement, DELETE, does not need a param.
Why don't you run them in separate commands?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Can you bake the value in the sql string instead of using bind? The current execute_all method is using the same bind params for each statement in the sql string. |
@gopikrishnaParisa You should use a SQLite transaction around the entire set of changes you're making. That will make your code much, much faster. If you don't do this, SQLite inserts a transaction around every statement. Committing a transaction is fairly slow since it has to ensure durability by flushing all writes to the physical storage device. |
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);
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.
The text was updated successfully, but these errors were encountered: