-
Goal: I try to insert values into a table with 7 columns. I populate them using the pSQL unnest function.
-
Steps:
How i pass the additional Scope:
save_room_param.trigger(
{additionalScope:{
parameterid: roomSQLData[0],
reportid: roomSQLData[1],
optionid: roomSQLData[2],
size: roomSQLData[3],
measure: roomSQLData[4],
comment: roomSQLData[5],
room: roomSQLData[6]
}}
)
My query:
INSERT INTO report_parameter (parameter_id, report_id, option_id, size, measure, comment, room)
VALUES (
unnest(array[{{parameterid}}]::int[]),
unnest(array[{{reportid}}]::int[]),
unnest(array[{{optionid}}]::int[]),
unnest(array[{{size}}]::int[]),
unnest(array[{{measure}}::text[]]),
unnest(array[{{comment}}::text[]]),
unnest(array[{{room}}]::int[])
)
- Details:
When i have a look at the Error Message the passing seems to be fine and the datatype is a integer array. But somehow within the SQL Prepared Statement it will be treated as text array with no possitiblity for conversion.
Does anybode has an idea how to solve that?