473,805 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB2 UDB LUW: (c1,c2) = ('10000','01/16/2004'): OK ( c1,c2) >= ('10000','01/16/2004'): NOK

Environment: DB2 UDB LUW (8.1.1.64)

DB2 Universal Database Version 8.1, 5622-044 (c) Copyright IBM Corp.
1991, 2002
Licensed Material - Program Property of IBM
IBM DB2 Universal Database SQL Explain Tool

*************** ***** PACKAGE *************** *************** *********

Package Name = "BDH002"."DYNEX PLN" Version = ""

Prep Date = 2004/08/31
Prep Time = 09:59:10

Bind Timestamp = 2004-08-31-09.59.10.620080

Isolation Level = Cursor Stability
Blocking = Block Unambiguous Cursors
Query Optimization Class = 5

Partition Parallel = No
Intra-Partition Parallel = No

SQL Path = "SYSIBM", "SYSFUN", "SYSPROC",
"BDH002"

-------------------- SECTION ---------------------------------------
Section = 1
SQL Statement:
DECLARE C1 CURSOR
FOR
select *
from bds001.ledger
where (account, dateins)=('6000 10100200', '06/25/2001')
fetch first 10 rows only
Section Code Page = 819

Estimated Cost = 100.130157
Estimated Cardinality = 1.000000

Access Table Name = BDS001.LEDGER ID = 4,24
| Index Scan: Name = BDH002.MY1 ID = 9
| | Regular Index (Not Clustered)
| | Index Columns:
"2" 86 lines, 2274 characters
| | Regular Index (Not Clustered)
| | Index Columns:
| | | 1: ACCOUNT (Ascending)
| | | 2: DATEINS (Ascending)
| #Columns = 29
| #Key Columns = 2
| | Start Key: Inclusive Value
| | | | 1: '600010100200'
| | | | 2: 2001-06-25
| | Stop Key: Inclusive Value
| | | | 1: '600010100200'
| | | | 2: 2001-06-25
| Data Prefetch: None
| Index Prefetch: None
| Lock Intents
| | Table: Intent Share
| | Row : Next Key Share
Return Data to Application
| #Columns = 31

End of section

SQL query works fine (and the optimization with index access we want
to have, even with no optimize for ... rows, neither order by).

But:

select * from bds001.ledger
where (account, dateins)>=('600 010100200', '06/25/2001')
fetch first 10 rows only

says:

SQL0104N An unexpected token "(" was found following "". Expected
tokens may
include: "". SQLSTATE=42601

So DB2 UDB understand = as part of row value constructor in a where
clause and finds the index, but >= is not understood in the same
syntax construct.
Cured (or should I write: implemented)in the 8.2 release?
Bernard Dhooghe
Nov 12 '05 #1
6 1578
I thought I answered this row-constructor thread sufficiently very
recnetly....
Nov 12 '05 #2
Serge Rielau wrote:
I thought I answered this row-constructor thread sufficiently very
recnetly....


I remember seeing it also. This query is attempting to do something that
cannot be coded as written.

The >= qualification should not distribute to multiple columns. When
multiple predicates are specified; either of these two interpretations
could be valid:
given: (a,b)>=(c,d)
1. ((a=c and b>=d) or (a>c))
2. (a>=c and b>=d)

There are a number of additional interpretations that could also be
valid. I'm happy the query was flagged as an error.

Phil Sherman

Nov 12 '05 #3
Serge Rielau <sr*****@ca.e ye-bee-em.com> wrote in message news:<pb******* *************@t wister01.bloor. is.net.cable.ro gers.com>...
I thought I answered this row-constructor thread sufficiently very
recnetly....


Hello Serge,

Indeed.

But.

At every release there is hope the SQL92 feature will be there
because:

1. this missing capabability is a lack of orthogonality (which does
not only matters for purists but also for practitioners), if there is
one thing that kills the confidence, respect and usage of a tool
(product in this case, it is not open source)is a lack of
orthogonality

2. quite a number of postings in this newgroup ask for it when
talking about searching and scrolling where keys composed of multiple
parts are involved and performance problems are reported

3. DB2 UDB can does not support what is clearly claimed as being
basic for a relational database: search and processing by content

So: again: when, when, when?

Bernard Dhooghe

Bernard Dhooghe
Nov 12 '05 #4
Bernard Dhooghe wrote:
Serge Rielau <sr*****@ca.e ye-bee-em.com> wrote in message news:<pb******* *************@t wister01.bloor. is.net.cable.ro gers.com>...
I thought I answered this row-constructor thread sufficiently very
recnetly... .

Hello Serge,

Indeed.

But.

At every release there is hope the SQL92 feature will be there
because:

1. this missing capabability is a lack of orthogonality (which does
not only matters for purists but also for practitioners), if there is
one thing that kills the confidence, respect and usage of a tool
(product in this case, it is not open source)is a lack of
orthogonality

NO, if there is on ething that killd confidence then it is missing
_highly_needed_ features. 2. quite a number of postings in this newgroup ask for it when
talking about searching and scrolling where keys composed of multiple
parts are involved and performance problems are reported Yes, but:
SELECT COUNT(DISTINCT authors) FROM postings WHERE content =
'ROWCONTRUCTORS '
=> 2
In other words; I admire your persistence. But please grant me that
asking for the same thing by the same person is not the same as asking
for the same thing by many distinct customers.
3. DB2 UDB can does not support what is clearly claimed as being
basic for a relational database: search and processing by content I'm obviously missing something here.... what are all thsoe customers
doing without this alleged core feature?
Note that there is no law about which features of SQL a given DBMS has
to support.
So: again: when, when, when?

As soon as you, instead of repeating the same pokes buidl a business
case that folks like I can present to their managers to get the resources.
And, no, orthogonality is nice, but it is not a business case.
So far I know of 1(!) example for which I don't understand the business
logic (>= for composit zip-codes).
We are running in circles on this.... and, by golly, we got enough
features requested in this group into the product. It's not that I mean
to be stuborn...

Cheers
Serge
Nov 12 '05 #5
Philip Sherman <ps******@ameri tech.net> wrote in message news:<iT******* ***********@new ssvr17.news.pro digy.com>...
Serge Rielau wrote:
I thought I answered this row-constructor thread sufficiently very
recnetly....


I remember seeing it also. This query is attempting to do something that
cannot be coded as written.

The >= qualification should not distribute to multiple columns. When
multiple predicates are specified; either of these two interpretations
could be valid:
given: (a,b)>=(c,d)
1. ((a=c and b>=d) or (a>c))
2. (a>=c and b>=d)

There are a number of additional interpretations that could also be
valid. I'm happy the query was flagged as an error.

Phil Sherman


Hello Phlip,

(a,c) >=(c,d) means exactly (SQL92 standard)

(a=c and c>=d) or a>c

The real problem is that (a,c) >= (c,d) has more semantic power than
the corresponding and/or query. There is no substitute for the row
value constructor clause unless cpu and disks have infinite speed,
than the and/or construct is fine, row value constructor would just be
a short way to write it. But the assomption of infinite power is not
realized yet.

Bernard Dhooghe
PS: UDB OO has taken a lot of investment money away to the detriment
of 'old' data processing needs. But these latter needs and these kind
of customers are funding DB2 development I think, not the OO
needs/sales (if this could have been predicted is another
discussion...)
Nov 12 '05 #6
Serge Rielau <sr*****@ca.e ye-bee-em.com> wrote in message news:<ip******* ********@news04 .bloor.is.net.c able.rogers.com >...
Bernard Dhooghe wrote:
Serge Rielau <sr*****@ca.e ye-bee-em.com> wrote in message news:<pb******* *************@t wister01.bloor. is.net.cable.ro gers.com>...
I thought I answered this row-constructor thread sufficiently very
recnetly... .

Hello Serge,

Indeed.

But.

At every release there is hope the SQL92 feature will be there
because:

1. this missing capabability is a lack of orthogonality (which does
not only matters for purists but also for practitioners), if there is
one thing that kills the confidence, respect and usage of a tool
(product in this case, it is not open source)is a lack of
orthogonality

NO, if there is on ething that killd confidence then it is missing
_highly_needed_ features.
2. quite a number of postings in this newgroup ask for it when
talking about searching and scrolling where keys composed of multiple
parts are involved and performance problems are reported

Yes, but:
SELECT COUNT(DISTINCT authors) FROM postings WHERE content =
'ROWCONTRUCTORS '
=> 2
In other words; I admire your persistence. But please grant me that
asking for the same thing by the same person is not the same as asking
for the same thing by many distinct customers.
3. DB2 UDB can does not support what is clearly claimed as being
basic for a relational database: search and processing by content

I'm obviously missing something here.... what are all thsoe customers
doing without this alleged core feature?
Note that there is no law about which features of SQL a given DBMS has
to support.
So: again: when, when, when?

As soon as you, instead of repeating the same pokes buidl a business
case that folks like I can present to their managers to get the resources.
And, no, orthogonality is nice, but it is not a business case.
So far I know of 1(!) example for which I don't understand the business
logic (>= for composit zip-codes).
We are running in circles on this.... and, by golly, we got enough
features requested in this group into the product. It's not that I mean
to be stuborn...

Cheers
Serge

Hello Serge,

My approach is just to say once in a newsgroup posting what I think,
so I will not answer a number of things that you comment on and we all
appreciate I think, even I don't agree.

On your query (result 2) and the business case to managers, these are
facts I will tackle.

The query result has a very low value because I'm the one who uses the
SQL92 qualification I've found in the Melton book on SQL92. But every
time I reply (not issuing it myself as for this one) on the newsgroup
on postings and refer to row value constructors, I answer to the same
problem people encounter when using DB2 UDB in building real life
applications (where composite keys are not an exception at all), so
the newgroup counter is certainly equal the times I replied to
postings in comp.databases. ibm-db2 when suggesting row value
constructors would help.

I refer to Chris Date who in his relational writings was first in
favor of surrogate keys, but changed it's view and accepted that in
people's world, keys can be composed of multiple parts that make sense
part by part and also all together.

Key-indexed files where good for at on-line browsing and scrolling
access and there is no reason a relational dbms could not handle the
feature.

In key-indexed files, the set can not be composed and it is based on
just one file/table, but the cursor can be set and scrolling can go up
and down.

In a rdbms the set can be composed but cursor position is weak and
most of the time/always(?) at the beginning of the set. So row value
constructors are just a partial solution but would be of great help.

Remark: I would see it as follows: split roles in set composition and
cursor positioning (orthogonality) :

select * from ... where ... order by c1, c2, c3,... position cursor
at (c1,c2,c3,...) <= > | >= | < | <=) ('...', ...)

but this is no SQL standard as far as I know.

This is why I see row-value constructors as a (first) solution and no
doubt it was introduced in SQL92 to handle real world needs.

Bernard Dhooghe
Nov 12 '05 #7

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

Similar topics

9
1349
by: Bjorn | last post by:
Hi, I need to determine the hightest date between e.g. "8/3/2004" and "8/4/2004". With this code, i get 'dat2' , which means that "8/4/2004" is higher than "8/3/2004". That 's right. But with "8/3/2004" and from "8/10/2004" (also "8/11/2004" ...) i get 'dat1'. <% dat1="8/3/2004"
0
1712
by: Philip Nelson | last post by:
Our next meeting will take place shortly and the "official" announcement is attached below. If you would like more information about our group then don't hesitate to drop me a line on teamdba@scotdb.com. We have tried to put together an interesting agenda which will give a useful day to both LUW and z/OS users. While traditionally our group has been "mainframe oriented", over the last year or so we have managed to build up a good LUW...
20
3452
by: Niyazi | last post by:
Hi all, I have a integer number from 1 to 37000. And I want to create a report in excel that shows in 4 alphanumeric length. Example: I can write the cutomerID from 1 to 9999 as: 1 ----> 0001 2 ----> 0002
2
3371
by: wugon.net | last post by:
Problem: after inser trigger encounter error sql0348 Env:db2 v8 + fp 13 + win xp Description: we build two after insert triggers DB2.TRG1, DB2.TRG2 on base table DB2.TEST1, insert data into DB2.TEST1 encounter error sql0348 but we re-create trigger DB2.TRG2 before DB2.TRG1 and re-insert data
3
5732
by: aj | last post by:
DB2 LUW 8.1 fixpak 14 Red Hat EL AS 4.4 I'm trying to diagnose some nocturnal CPU pressure, and am trying to understand the dynamic statement cache as it applies to LUW. The only doc/redbooks I am finding are for Z/OS, which I am completely ignorant of. I am using only Java and JDBC in my applications. No static SQL.
2
5882
by: F | last post by:
Is DB2 on z/OS same as DB2 on LUW ? Will my DB2 DBA on one environment have to retrain again on the other ? Thanks
4
2260
by: Troels Arvin | last post by:
Hello, We have started planning our DB2 generation 8 -9.1/9.5 upgrades, as April 30 2009 is no longer distant future (ordinary support for DB2 generation 8 on Linux/Unix/Windows==LUW will end on April 30). We are unsure if it's safe to move directly to version 9.5, or if we should proceed more cautiously to version 9.1. So I'm interested in hearing about people's experiences regarding DB2 LUW
6
3298
by: Lennart | last post by:
I'm trying to read up on the possibility to migrate a db2 V9.5 server to 64 bit, and continue running 32 bit application servers (via db2 runtime client, or otherwise). Does anyone have links to this kind of information? I've google around a bit, and searched the db2 docs without much success so far? Is it at all possible, what restrictions apply for such a setup, etc is the kind of questions I would like to find info about. Thanx in...
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10361
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
10103
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
9179
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, and deployment—without 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
7644
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
5536
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...
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3006
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.