Dynamic statement using FORALL INSERT
Hi.
I have 3 INSERT statement that changes based on an input parameter. For example
- T_ANN is the table for ANNUAL
- T_PREV is the table for PREVISION
- T_STANDARD is the table for STANDARD
The result set I want to insert, comes from a PL/SQL TABLE (REF_CURSOR), so I would like to use a dynamic FORALL to insert it into the table. The only thing that change is the table name. I'm looking for something like this:
- EXECUTE IMMEDIATE 'insert_statment' USING table_to_insert
where
- "table_to_insert" is the PL/SQL table from REF CURSOR