SQLite Forum

string concatenation issue in prepared statement
Login
I do not grok swift or know what version of SQLite ships with iOS (14). However, I can assert that SQLite v3.33.0 handles your parameter substitution correctly and as you hoped. This fact is demonstrated by the following session screen-scrape:<code>
> sqlite3
SQLite version 3.33.0 2020-08-14 13:23:32
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .parameter set :myvar B
sqlite> select 'A'||:myvar||'C';
ABC
sqlite>
</code>

I also know that parameter substitution has worked correctly in most (if not all) SQLite library versions released over the last decade (if not much longer) and up to the v3.35.0 prerelease.

From that evidence, I conclude that something is going wrong with your call into sqlite3_bind_text().