Created
August 13, 2015 14:52
-
-
Save ststeiger/c3285bffb2097ab0623a to your computer and use it in GitHub Desktop.
Arrays as Parameters in pgSQL
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
| SELECT * FROM some_table WHERE id_column = ANY(@id_list) | |
| -- where @id_list is bound to an int[] parameter by way of | |
| SELECT * FROM some_table WHERE id_column = ANY(@id_list); | |
| -- Code: | |
| command.Parameters.Add("@id_list", NpgsqlDbType.Array | NpgsqlDbType.Integer).Value = my_id_list; | |
| where command is a NpgsqlCommand |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment