473,396 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Delay Time when executing sql command

kirubagari
158 100+
Attach my sql and i need to put wait for delay command so that the sql will process after 59 second to optimize cpu usage.I dont know how to handle the scenario.
The changes is i want to reduce no. of records per query compared to current one.I might need to put delay
time.The code is error when perform the compiling since im using PRO*c

Expand|Select|Wrap|Line Numbers
  1. EXEC SQL EXECUTE 
  2.                     BEGIN 
  3.                        INSERT INTO caruser.fwcarrierhistory_hist
  4.                                   (sysid, carrierid, carriertype, carrierstate, carrierstatus,
  5.                                     componentqty, lotid, LOCATION, activity, txntime, txncomment,
  6.                                     cleancount, usedcount, lastcleandate, grouphistkey, txnkey,
  7.                                     username)
  8.                           SELECT sysid, carrierid, carriertype, carrierstate, carrierstatus,
  9.                                  componentqty, lotid, LOCATION, activity, txntime, txncomment,
  10.                                  cleancount, usedcount, lastcleandate, grouphistkey, txnkey,
  11.                                  username
  12.                             FROM caruser.fwcarrierhistory
  13.                            WHERE sysid = :sysId; 
  14.                        DELETE FROM caruser.fwcarrierhistory
  15.                              WHERE sysid = :sysId;
  16.                              WAITFOR DELAY '00:00:59';
  17.                        INSERT INTO caruser.fwcarrierhistory_pn2m_hist 
  18.                                    (fromid, linkname, SEQUENCE, valtype, valdata, keytype,
  19.                                     keydata)
  20.                           SELECT fromid, linkname, SEQUENCE, valtype, valdata, keytype, keydata
  21.                             FROM caruser.fwcarrierhistory_pn2m 
  22.                           WHERE fromid = :sysId; 
  23.                        DELETE FROM caruser.fwcarrierhistory_pn2m 
  24.                              WHERE fromid = :sysId;
  25.                              WAITFOR DELAY '00:00:59';                       INSERT INTO caruser.fwcarriercomment_hist 
  26.                                    (sysid, commentcode, briefdescription, detaildescription)
  27.                           SELECT sysid, commentcode, briefdescription, detaildescription
  28.                             FROM caruser.fwcarriercomment 
  29.                           WHERE sysid = :txnComment; 
  30.                         DELETE FROM caruser.fwcarriercomment 
  31.                             WHERE sysid = :txnComment;
  32.                         COMMIT;
  33.                     END; 
  34.         END-EXEC; 
May 25 '11 #1
1 12373
rski
700 Expert 512MB
To delay use sleep function
Expand|Select|Wrap|Line Numbers
  1. exec dbms_lock.sleep(59);
  2.  
May 27 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: new1s.on.sympatico.ca | last post by:
Hey There! Any one have any ideas on how to prevent the DOS window from appearing when executing an Output Assembly (exe) generated using CodeDom? Thanks, Roland
2
by: Pascal Polleunus | last post by:
(another try with a different subject as it doesn't seem to work with "EXECUTE + transaction = unexpected error -8" :-/) Hi, It seems that there is a problem when executing a dynamic...
1
by: Lana rose | last post by:
Is there a way of hiding the command prompt window when executing some code in C++ that needs no input from the reader? it is simply a piece of code that reads some data from one file and...
2
by: psbasha | last post by:
Hi , I am getting the following error in ActiveState ActivePython2.4,when executing the UI which I worked in Python2.4.2 downloaded from www.Python.org ...
0
by: shanmugam | last post by:
Hi All How can i hide the command prompt window when executing the system command in perl. Thanks in advance Shanmugam
1
by: dahansen | last post by:
I have very limited knowledge of access, but the database I am using started displaying an error message a few days ago. When I try to open the form database using the switchboard it says "Error...
2
by: mike.lopiano | last post by:
There is a significant gap (~ 3.5 minutes) in the time our LOAD command indicates that the BUILD phase is complete and the time we have control returned to our script. I ran the test below on a...
5
by: IgorZ | last post by:
Hello i made a program based on the tutorial on youtube. It's suppose to calculate the average between 3 numbers so i got some questions about that. 1. How to detect when a person enters a number...
3
by: natraj A V | last post by:
Which method will be called when executing a .exe file?
2
by: osman7king | last post by:
when executing the function as follow: select get_pms_meeting_minute (null) I get the follwing message: set-valued function called in context that cannot accept a set CREATE TABLE...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.