Last active
August 29, 2015 14:21
-
-
Save fmcgeough/cbb777816d951bf46b45 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sql = 'select * from account_status where account_status_id in ($1)' | |
| params = [1, 2] | |
| # obviously wrong. 2 params instead of 1 | |
| db.exec_params(sql, params) | |
| # PG::IndeterminateDatatype: ERROR: could not determine data type of parameter $2 | |
| params = [[1,2]] | |
| db.exec_params(sql, params) | |
| # PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: "[1, 2]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment