If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > procedure need help!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-22-03, 14:06
kornvipa kornvipa is offline
Registered User
 
Join Date: Oct 2003
Location: bkk
Posts: 2
procedure need help!

I want to write program that use procedure in pl/sql to update table by 2 condition below,
1.update table x set x.a=(select y.a from y
where y.b=x.b)
if y.a is null then update table x set x.c=1,
2.update table x set x.d=(select z.d from z
where z.g=x.g)
if z.d is null then update table x set x.c=2

this program will update about 100000 rows.
how I write program that good performance, help me please?

Thank you for your help very very much

Last edited by kornvipa; 10-22-03 at 14:09.
Reply With Quote
  #2 (permalink)  
Old 10-22-03, 15:10
dbmadcap dbmadcap is offline
Registered User
 
Join Date: May 2003
Posts: 87
Do you need the logic or do you need to know how to effeciently update 100000 rows? I would use bulk binds to update those many rows. It uses the native pl/sql engine and the updates are much faster.
Reply With Quote
  #3 (permalink)  
Old 10-23-03, 10:49
kornvipa kornvipa is offline
Registered User
 
Join Date: Oct 2003
Location: bkk
Posts: 2
Thank you for your reply.
I'm use pl/sql at first time I'm a beginner,so I want to know both logic and need effeciently.
Can you guide me how to write program with condition that I post or can you coding example of program!

Thank you,
Reply With Quote
  #4 (permalink)  
Old 10-23-03, 15:28
dbmadcap dbmadcap is offline
Registered User
 
Join Date: May 2003
Posts: 87
If you can post the pseudo code or logic, I can help you write the pl/sql code. And then, show you how to write it using bulk updates.

In the meanwhile, you can start reading some book on pl/sql or the documentation at http://tahiti.oracle.com

Quote:
Originally posted by kornvipa
Thank you for your reply.
I'm use pl/sql at first time I'm a beginner,so I want to know both logic and need effeciently.
Can you guide me how to write program with condition that I post or can you coding example of program!

Thank you,
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On