Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Using Cursors and Cursor Vars to Insert/update - How faster?
Thanks in advance everyone for your help.
I am trying to figure out if it's possible to use a cursor row record or equivalent with cursor variables to ease the coding necessary to insert and update tables. Below is my pseudo-code for what I'd like to do, but which to this point haven't figured out how to do it.
create or replace procedure test
is
cursor cur is select * from table_A; cv cur%ROWTYPE;
for cv in cur loop insert into TABLE_B values( CV ); -- somehow use thecv row to supply all the values
end loop;
end;
/
I would also like a way to accomplish a similar thing for updates, as in:
update TABLE_B insert cv where current of table_A; OR update table_A insert cv where current of table_A;In the first one I am assuming that table_A and TABLE_B have exactly the same columns, etc.
I would think there would be a way to take advantage of the fact that Oracle already houses all the columns in the above "cv" rowtype. I would like think they have a simple way to utilize all the values for the columns all at once.
Does any one know how to do this?
Thanks again,
Ken Sproule
kenmn_at_tds.net
Ken Sproule
kenmn_at_tds.net
Received on Thu Mar 23 2000 - 07:35:40 CST
![]() |
![]() |