0

I have a stored procedure:

create or replace procedure AAAAAA(
ID in dbms_sql.number_table,
Name in dbms_sql.varchar2s
)
is
 tableName varchar2(30) := 'QWERT_';
Begin
Forall k in 1...ID.COUNT SAVE EXCEPTIONS
EXECUTE IMMEDIATE  'insert into ' || tableName || ID(k) ||   
' values (:1,:2)' using ID(k), NAME(k);
--EXCEPTION HANDLING CODE
End;

But , on compiling above code i am getting

[Error] PLS-00801 (9: 5): PLS-00801: internal error [* ASSERT at file pdw4.c, line 607; Unknown expression Expr = 283.; AAAAAA_FFF_P__274784[9, 5]]. "tableName || ID(k) " table already created before running this procedure.

Any idea why i am getting this error. Please help.

1 Answer 1

5

The FORALL has to insert into the same table. It does a single PARSE and multiple BIND/EXECUTES. As such you can't use an array variable [ID(k)] to form your table name.

Sign up to request clarification or add additional context in comments.

1 Comment

If i want to have such query then is there any workaround of it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.