Search code examples
sqlitefmdb

FMDB - Passing Parameters for TEXT Data Types


I'm using FMDB to connect to my SqlLite database for an iOS Swift app.

My query is this for a text field (I changed the column names to simplify)

let externalQuery: FMResultSet = db.executeQuery("SELECT Field1, Field2 from MyTable where Field2 = ? ", 
withArgumentsIn: [someVariable])

Should the question mark have quotes around it if the column Field2 is of type TEXT in Sqllite?

For example should the query be this instead?

let externalQuery: FMResultSet = db.executeQuery("SELECT Field1, Field2 from MyTable where Field2 = '?' ", 
withArgumentsIn: [someVariable])

Thank you!


Solution

  • No quotes are required, which should be easily confirmed with a quick test run.