DB2 V8
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Database

#1: DB2 V8 Author: Martin PostPosted: Tue Apr 10, 2007 1:00 pm
    —
Sometime back I happen to read an article on the net which talked about the advantages of migrating to DB2V8. ( I dont have the link right now.. Sad )

Could any one provide some info about migrating to DB2V8. Also I read that the ORDER BY clause a must in a cursor.

Could any one let me why this is a must ? what about the program which do not have order by clause ?

#2:  Author: kolusuLocation: San Jose PostPosted: Tue Apr 10, 2007 2:05 pm
    —
Here is an excellent article about DB2 V8

http://www.dbazine.com/db2/db2-disarticles/zikopoulos11

Also read this book

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNWNJ11/CCONTENTS?DT=20061212110132

Order by clause is a MUST? I haven't heard any thing about it

Kolusu

#3:  Author: CZerfas PostPosted: Wed Apr 11, 2007 2:55 am
    —
From a technical point of view, ORDER BY is a must in a restartable Batch program, to be able to reposition a cursor after an interruption.
Talking about business, work is normally done in a time, partner or account orientation, and there an ORDER BY is very helpful indeed.

Just my two cents.
Christian

#4:  Author: kolusuLocation: San Jose PostPosted: Wed Apr 11, 2007 8:39 am
    —
CZerfas,

Do you still need an ORDER By in the following scenario?

A BMP program is to update a flag in a table from 'n' to 'y'
It opens the cursor and updates each row 1 by 1 flipping the flag (single update will do but it is a huge table which might cause deadlocks)

Now do you still need a order by ?

The same case also applies when you are deleting rows of the table

KOlusu

#5:  Author: CZerfas PostPosted: Thu Apr 12, 2007 3:07 am
    —
Hello Kolosu,

well, shurely not. But speaking of a general advice, there are not many opportunities where you can omit an ORDER BY.

Since every ORDER BY eats ressources, it is always worth to ask yourself, whether you really need an ORDER BY clause.

regards
Christian

#6:  Author: Martin PostPosted: Fri Apr 20, 2007 12:45 pm
    —
Kolusu,

We were hit by this PROD. There was a SQL which did not have ordaer by clause and the rows fetched from this cursor was used as a driver for orther programs. Now in V8 the order in which the rows will be fetched is diff from what it was in V7.

Any thougths as to why would they change the ordaer in which the data gets retrieved.

-Mt

#7:  Author: kolusuLocation: San Jose PostPosted: Fri Apr 20, 2007 1:13 pm
    —
Quote:

Now in V8 the order in which the rows will be fetched is diff from what it was in V7.


martin,

You need to remember that we are communicating via web. When you say something does not work you need to provide us with enough information to suggest a solution.

Show us the sql and a sample of the data and explain to us why you think it is wrong.


Kolusu

#8:  Author: dbzTHEdinosauerLocation: germany PostPosted: Fri Apr 20, 2007 1:37 pm
    —
I don't think that DB2 guarantees the same results table for multiple executions of a CURSOR, when there is no ORDER BY clause in the SQL; though they may be the same, DB2 is not trying to provide the same order each time.



MVSFORUMS.com -> Database


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group