How to code multiple parameters in an sql type call

How do you code multiple parameters like in the following:
let custlist = try Customers.fetchAll(db,
sql: "SELECT * FROM Customers WHERE custFname = ? and custLname = ?",
arguments: [custFname], [custLname])
Would someone give me an example of how to code this? I have looked at the documentation and I did not see an example like this. I want to build and sql query that in this case has two. variables passed to that I are filled in dynamically. There might be a better way I am open to suggestions .
Thanks

Hello @Eagle442BR,

Your solution is a single array containing all query arguments:

let custlist = try Customers.fetchAll(db, sql: """
    SELECT * FROM Customers
    WHERE custFname = ? and custLname = ?
    """, arguments: [custFname, custLname])

thanks, that took care of it..

Terms of Service

Privacy Policy

Cookie Policy