Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I love this site! It's so nice to know that there are so many people out there who are willing to share their knowledge..."

Geography

Where in the world do Tek-Tips members come from?
dbomrrsm (Programmer)
11 May 07 6:15
I have a cursor that I fetch using bulk collect into an array.

I then use FORALL x IN a_array.FIRST..a_array.LAST and do an update of tablea with a where condition of: field_a = a_array(x); - this works fine

I then need to delete from a different table so do delete from tableb with a where condition of: where field_b = a_array(x);

because there are now two dml statements the second one errors with PLS-00201: identifier 'X' must be declared and this highlights the x in brackets in the second dml statement.

Is is possible to carry out multiple dml statements within a forall ?

TIA

bandito DBomrrsm bandito

Software code, like laws and sausages, should never be examined in production - Edward Tenner

Helpful Member!  Dagon (MIS)
11 May 07 7:52
You will need two FORALL statements.
dbomrrsm (Programmer)
11 May 07 8:11
Dagon

Had tried that and it worked but thanks for taking the time to reply.

bandito DBomrrsm bandito

Software code, like laws and sausages, should never be examined in production - Edward Tenner

Dagon (MIS)
11 May 07 9:43
Although it looks like a loop, FORALL isn't.  It only relates to the statement which follows.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close