Timeline for PLPGSQL: Cannot use parameters inside a function query
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 7, 2020 at 14:17 | comment | added | John K. N. |
At some point the variable is going to be have to "added" (concatenated) to the string value that you are passing to the crosstab table function. Your options would be: 1.) Add the whole select string as the parameter to the function/procedure. 2.) concatenate the string into a variable inside the function/procedure and assign that variable in the crosstab( here, ....) table function.
|
|
Sep 7, 2020 at 12:13 | vote | accept | Sinipelto | ||
Sep 7, 2020 at 12:13 | comment | added | Sinipelto | Escaping the variabes outside of the string seems to work. I was wondering if the query could be done without using the strings so that escaping the variables would not be necessary? | |
Sep 7, 2020 at 11:10 | history | edited | John K. N. | CC BY-SA 4.0 |
added db<>fiddle
|
Sep 7, 2020 at 11:02 | history | answered | John K. N. | CC BY-SA 4.0 |