0

I have added rows from a table into a variable of type dbms_sql.varchar2_table.

select id 
  bulk collect into collValyes 
  from tabl1;

collValyes is a variable of type dbms_sql.varchar2_table. Now i have to use collValyes in where clause.Like

update Table2 
   set Status ='R' 
 where id in collValyes .

one xecuting above query , I am getting

PLS-00382: expression is of wrong type

I searched a lot on web but did not find the solutions. Please help

1 Answer 1

3

You can use the FORALL bulk processing for your update:

FORALL x IN INDICES OF collValyes
   UPDATE Table2
      SET status = 'R'
    WHERE id = collValyes(x);

You can find out more about Oracle FORALL here:

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/forall_statement.htm

Hope it helps...

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.