Created
October 13, 2023 07:07
-
-
Save harish2704/5b598ac571006f1cbbb944ba72e948d4 to your computer and use it in GitHub Desktop.
pass data as query parameter while using SQL insert into ( batch mode ) statement
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
INSERT INTO my_table (col_a, col_b) | |
(SELECT col_a, | |
col_b | |
FROM json_populate_recordset(NULL::my_table, ?) | |
) | |
-- Here query parameter should be a json collection ( array of objects ) which matches with column names of my_table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment