1

I have written below code.

Declare
  Type t1 is record (id, type)
  Type t2 is table of t1;
  V_val t2;
Begin
  Select a.id, a.type 
    bulk collect into v_val 
    from table1 a 
   where exits(select 1 from table2 b where a.column = b.column);..
.
.

Some code is written here. If .. And now I am trying to insert collection variable into 1 table using execute immediate. Eg.

Execute immediate 'insert into ' || table || v_column_string ||  ' from' || table|| q'where type =1 and  flag =:1...

this is the main statement. Now I want to concatenate this insert state using my collection variable above something like below

Execute immediate 'insert into ' || table || v_column_string ||  ' from' || table|| q'where  flag =:1 and exists ( select 1 from table(v_val)y where y.id = id and y.type = type)

Using another variable.

Can anyone help me with this? Tried all the way but no luck... I am new to plsql coding. It will be great help .

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
  • Execute immediate ' insert into ' || i.tablename || '(' || v_column || ')' || 'select ' || V_col_rf || ' from ' || i.tablename || 'r' || 'from table(' || collection Variable|| ')y where y.node = r.node)' using v_rf_flg; What is wrong in this statement getting wrong number or types of argumenta in call to || error. Can anyone help? Thanks in advance – Kirti Waghmare Nov 03 '21 at 12:44

0 Answers0