Skip to content
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

Sqlite multiple statement with semi colon not working from iOS app #32

Open
jigneshchovatiya opened this issue May 31, 2016 · 1 comment

Comments

@jigneshchovatiya
Copy link

I have to update multiple statement in sqlite database from my iOs app. for that I have written following string.

query = @"UPDATE channels set sts = 'A' , isowner = '1' WHERE channelid=6798;
UPDATE channels set sts = 'A' , isowner = '1', srl = '175' WHERE channelid=6795;";
NSLog(@"query %@",query);
[dbManager executeQuery:query];

I have create a string/statment as string with semi colon. It is worked perfectly in sqlite browser/editor, but not working in iOS app. It not throwing any error while executing statement. I don't find any mistake in my code. (as per my best knowledge). Can someone help me, why it is not working?

It is very urgent for me.

Thanks.

@bluetechy
Copy link

I believe by default the sqlite3 library prevents this for security reasons because it exposes an SQL insertion attack. Here are a few possible solutions:

  1. Separate the UPDATE statements and run them separately (probably best within a transaction).
  2. Edit https://github.com/ziminji/objective-c-sql-query-builder/blob/ARC/master/src/db/ZIMDbConnection.m#L146-L193 by un-commentting the commentted lines and comment out the sqlite3_exec command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants