I wanna insert muliples rows with a single insert, but only the last data is mutable from a list.
INSERT INTO TB_TEMPLATE (
)VALUES ('42','78', X)
Something like this will work, assuming you are hard-coding the X value (and assuming the values are NUMBER, so they must be converted to VARCHAR2 before insertion - this is done with
to_char()). Adapt as needed. If the list already exists as a column in a table, select that column from the table instead of "
union all" from
INSERT INTO TB_TEMPLATE ( ID_BENEFICIO,ID_PROGRAMA,DDD ) with value_list ( x ) as ( select 11 from dual union all select 15 from dual union all select 17 from dual union all select 19 from dual -- etc. ) select '42', '78', to_char(x) from value_list ;