-
Hi
Feels somewhat complicated, but no so!!!!
For a particular program, I plan to use many DML in a loop as given below. Please suggest me if it will have a adverse effect on the database.
In my application, I have a table(A) with 2 columns
(Account_number & accoutn_no_changed_to)
Entries in A look like
Acc_No(A1) Acc_change_to(A2)
1 10
2 3
3 4
5 6
I need to update this with the account table. So I use this logic
i=1;
while i > 0
{ insert into B using self join A2= B1 ; // B is similar to A;
delete from A for all rows in B;
update account from A;
truncate A;
rename A to C; // for swaping tables;
rename B to A;
rename C to B;
i = select count(*) from A;
}
1)If It is clear
a) Please tell me having so many DML's effect on DB
b) Is there a better way of doing it;
Badrinath.
-
IF you are trying to use the PLSQL, DDL (renaming) wouldn't be feasible.
Sam
Thanx
Sam
Life is a journey, not a destination!
-
Hi Sam,
I am using oracle 8.1.6, where in I can use execute immediate command to use DDL's also,. It works.
-
Can the advisors/DBA's throw some light on this
(about the entire logic defined above)
Badrinath
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|