Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. --Here are my declarations. Note that there is more than one column in the record.
  2. --The examples I could find online only use one column:
  3. type mytable_rec is record
  4. (
  5. mytable_col1 mytable.mytable_col1%type,
  6. mytable_col2 mytable.mytable_col2%type
  7. );
  8.  
  9. type mytable_tab is table of mytable_rec;
  10.  
  11. l_mytable mytable_tab ;
  12.  
  13. --I've already loaded my query into l_mytable using bulk collect.
  14. --Skipping it for readability
  15.  
  16. forall i in 1 .. l_mytable.count loop --The procedure won't compile
  17. --because of this line
  18. update mytable set
  19. mytable.mytable_col1 = i.mytable_col1,
  20. mytable.mytable_col2 = i.mytable_col2
  21. where 1 = 1; --some condition goes here
  22. end loop;
  23.  
  24. forall i in l_mytable.first .. l_mytable.last loop --The procedure won't compile
  25. --because of this line
  26. update mytable set
  27. mytable.mytable_col1 = i.mytable_col1,
  28. mytable.mytable_col2 = i.mytable_col2
  29. where 1 = 1; --some condition goes here
  30. end loop;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement