473,770 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

New "High-performance SQL" article on developerWorks/DB2

Contains a major blurp on SELECT FROM INSERT and some other hopefully
useful tricks.

http://www-106.ibm.com/developerwork...dm-0411rielau/

Enjoy
Serge
Nov 12 '05 #1
5 2257
Hi, serge.
Lots of "old table", "new table" function.
Where is the original definition of those stuff?

Serge Rielau <sr*****@ca.ibm .com> wrote in message news:<30******* ******@uni-berlin.de>...
Contains a major blurp on SELECT FROM INSERT and some other hopefully
useful tricks.

http://www-106.ibm.com/developerwork...dm-0411rielau/

Enjoy
Serge

Nov 12 '05 #2
richard wrote:
Hi, serge.
Lots of "old table", "new table" function.
Where is the original definition of those stuff?

Serge Rielau <sr*****@ca.ibm .com> wrote in message news:<30******* ******@uni-berlin.de>...
Contains a major blurp on SELECT FROM INSERT and some other hopefully
useful tricks.

http://www-106.ibm.com/developerwork...dm-0411rielau/

Enjoy
Serge

Here is an intro:
http://publib.boulder.ibm.com/infoce...d/c0011133.htm
The formal definition is here under "subselect" :
http://publib.boulder.ibm.com/infoce...n/r0000875.htm

Maybe in future articles I should link right into the docs....

Most of the other stuff you will find in UPDATE, DELETE, INSERT statement:
http://publib.boulder.ibm.com/infoce...n/r0000939.htm

Look for everything marked as new in FP4.

Cheers
Serge
Nov 12 '05 #3
AK
Serge,

it is very interesting, thanks.
One thing about Delivery table function is not clear to me.
I don't understand if deadlocks are ever possible when calling the
function simultaneously from several connections.
Can you explain please?
Nov 12 '05 #4
AK wrote:
Serge,

it is very interesting, thanks.
One thing about Delivery table function is not clear to me.
I don't understand if deadlocks are ever possible when calling the
function simultaneously from several connections.
Can you explain please?

There are no deadlocks possible (anymore).
Without SELECT FROM DELETE however the code would have to look like this:
SET VAR_O_ID
= (SELECT MIN(NO_O_ID)
FROM NEW_ORDER
WHERE NO_W_ID = DEL.W_ID
AND NO_D_ID = DEL.D_ID);
DELETE FROM NEW_ORDER
WHERE NO_O_ID = VAR_O_ID;
Since there is more than one delivery "daemon" chances are that two of
them will try to delete the same order.
Both will get a S lock on MIN(NO_O_ID) which they try to upgrade to an
exclusive lock.. and that would be the end.

Multiple solutions are thinkable involving at 2 SQL statements:
WITH RR USE AND KEEP EXCLUSIVE LOCKS will get the lock right away.
Using a cursor FOR UPDATE (over the ORDER BY) will position the row so a
DELETE WHERE CUURRENT OF can operate on it.

Cheers
Serge
Nov 12 '05 #5
AK
thanks Serge
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1400
by: Gianluca_Venezia | last post by:
Talking about high number of record seem ridiculus, if this number is about 88.000 but when I open a form, linked via ODBC to a MYSQL table, the open and the use of that form is slow, and very slow if the form has combo controls. I have a order form, and a combo control for custemer codes. Order table counts 88.000 records, customer tables has 1.500 records.
8
1650
by: Tamir Khason | last post by:
I just testing my program on Windows PE with Framework 1.1 pre-installed and got a message "high encryption pack not installed" - what's the hell? The only information I found in inet is related to some pyton issues with networking, but nothing about .NET. Someone have a clue what it can be? Thank you -- Tamir Khason You want dot.NET? Just ask:
3
3127
by: asognoth | last post by:
Hi... Does anybody have a clue how to solve this problem? the task is to change the following method in that manner that it draws the (calculated) image form left to right instead of from top to bottom. The image is actually a waterfall model of sound data. I tried desperatly, but I don't see how to swap the x and y coordinates.
17
2317
by: Mike Hofer | last post by:
While I'd toyed with C, C++, and Java over the last 20 years or so, my principal language has been BASIC, QBASIC, then Visual Basic, and finally Visual Basic .NET. But lately, I've been using C# and I absolutely *love* it. It makes me think more about what I'm doing it before I just spew code into the editor. I'm writing better code than ever. The only thing so far that I don't like about it is the switch construct. I can't do this:
9
1244
by: Mike Labosh | last post by:
Code is easy. These are two OOP design issues that I am chewing on. Coming from classic VB, I'm not great at OO design. I prefer to write mile long spaghetti methods in a Temp module, and then refactor them. Issue # 1 I have an Employee class that represents the state of an Employee record, and an EmployeeListItem class that represents Employee stuff to be loaded into a ListBox, e.g. EmployeeID, FirstName, LastName, ReadOnly...
22
3670
by: Xah Lee | last post by:
The Nature of the “Unix Philosophy” Xah Lee, 2006-05 In the computing industry, especially among unix community, we often hear that there's a “Unix Philosophy”. In this essay, i dissect the nature and characterization of such “unix philosophy”, as have been described by Brian Kernighan, Rob Pike, Dennis Ritchie, Ken Thompson, and Richard P Gabriel et al, and in recent years by Eric Raymond.
169
9216
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide untaking to create a toolchain for it. Way back when, there used to be something called "Small C". I wonder if the creator(s) of that would want to embark on creating a nice little Small C++ compiler devoid of C++ language features that make...
3
5039
blazedaces
by: blazedaces | last post by:
I was working all day yesterday (and will probably be for most of today) with bytecode where java wrote the bytecode and matlab read it... I had never worked with bytecode in great detail before so this was quite a challenge. I mean, all in all, the experience was interesting and because it was harder then it should have been, more educational. Still, I've been told almost every other program reads "low byte first" and thinking about it,...
1
1144
by: ALi Shaikh | last post by:
I searched the net countless times yet i am not able to find anything at all....does any know where I can find some info..??
30
3848
by: Medvedev | last post by:
i see serveral source codes , and i found they almost only use "new" and "delete" keywords to make they object. Why should i do that , and as i know the object is going to be destroy by itself at the end of the app for example: class test { public: int x;
0
9617
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
1
10036
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8929
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7451
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2849
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.