473,511 Members | 16,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to set priority

4 New Member
Hi Guys,

I have written a stored procedure having couple of insert and delete statements
example:
delete from mastertable1; //delete the records from master table
insert into mastertable1 select *from temptable1;
delete from temptable1; //delete the records from temp table

delete from mastertable2;
insert into mastertable2 select *from temptable2;
delete from temptable2;

Here the problem is some times the delete taking the priority than insert statement.... i.e "delete from temptable1;" statement executing first and then "insert into mastertable1 select *from temptable1;".

How can i avoid this... (in MS SQL server we have GO command.).. please help me out...

thanks in advance...
Mar 9 '08 #1
1 2739
docdiesel
297 Recognized Expert Contributor
Hi,

try to switch off autocommit and then use a COMMIT statement after each step. Furthermore, the DELETE statements may be taking a lot of time. If you need to delete all the records in a table, you could use a (very fast) LOAD command instead:

Expand|Select|Wrap|Line Numbers
  1. LOAD from /dev/null OF IXF REPLACE INTO temp.table ;
/dev/null will work on Linux or *nix systems. On Windows, "nul" may work. Otherwise use an empty file.

DB2 also enables you to use "Global Temporary Tablespaces" for temp. tables, which means the tables contents are valid for the current transactions and after disconnecting all the records just vanish by magic. You may even switch off the logging on these temp. tables, increasing the speed of your transactions.

Regards,

Bernd
Mar 9 '08 #2

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

Similar topics

4
4881
by: Joe Wong | last post by:
Hi, Is there any way to increase/decrease a thread priority in Python? Best regards, -- Wong
18
12555
by: Ken | last post by:
Hi. Can anyone refer me to any articles about the compatibility between c++ polymorphism and real-time programming? I'm currently on a real-time c++ project, and we're having a discussion...
4
8884
by: Trev Hunter | last post by:
Hi All, I was just wondering if it is safe to change thread priorities with thread pool threads (threads used by System.Threading.Timer and those used by the ThreadPool class itself). Say I...
1
5005
by: Norm | last post by:
I have a program that is cpu intensive so I want to change it's priority to BelowNormal. The code functions without error, the VS Debugger shows the change but when I then go to "Windows Task...
38
5734
by: Aaron W. LaFramboise | last post by:
Hello, I understand that an easy way to make the standard std::priority_queue stable is by including an integer stamp with each node that is incremented each time a new node is pushed into the...
1
2890
by: Jim Strathmeyer | last post by:
So, I've been looking for a wrapper class for STL priority queues, and haven't been able to find one. (Websearching for info about the STL sure shows how much it's changed over the past few years.)...
5
13211
by: Dan H. | last post by:
Hello, I have implemented a C# priority queue using an ArrayList. The objects being inserted into the priority queue are being sorted by 2 fields, Time (ulong) and Priority (0-100). When I...
4
4197
by: Harry J. Smith | last post by:
How can a program change its execution priority in the operating system while it is running? -Harry
9
6065
by: Eugeny Balakhonov | last post by:
Hi! How to change query priority dynamically? I have a web site which uses PostgreSQL as a host database and a background program which uses this database too.
0
1727
by: savajx1 | last post by:
The programming task is to run a simulation model, as a distributed computing model, in the background on 250 departmental computers. I intend to allocate work (per machine) into say "5-10 cpu...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7423
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...
1
7081
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
5668
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,...
1
5066
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
447
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.