× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I've been thinking about this topic - vacation, you know!

Seems to me that primary keys are not the same thing we think about when creating a keyed logical file or even putting a key on a physical file - one of the paradigms shifts we need to do (ah - another word we seldom use, like obfuscate, but what fun to do it once in a while!). I believe the purpose of a primary key is primarily (sic!) to give a unique identifier for each row in a table.

I did a google on "primary key" and found this interesting little article:

http://www.aisintl.com/case/relational_keys.html

One sentence is very apt in this discussion, food for thought:

A key is about uniqueness, not access, while an index is about access, and not necessarily uniqueness.

See the article for more and also some links.

Basically, it seems a key - primary or unique - is not meant for sorting rows for access - on the iSeries we certainly CAN use them as an index, but that is not the SQL way of thinking.

A key does not include the idea of order, so, no, you can't have a descending primary key. OTOH, when I googled "primary key descending" I got some links to Foxpro and Oracle - some had ways to do it, some did not that I could see quickly.

So the suggestion to make a separate descending "key" - actually, "index" according to the above link - is a good one.

Hmmm!

Vern

At 02:11 PM 12/19/2007, you wrote:

Why not create an index with a descending key over the table and
then use the index in the HLL?

Guy Murphy
murphyfa@xxxxxxxx
University of Illinois Foundation
217-333-8979


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jeff Crosby
Sent: Wednesday, December 19, 2007 12:00 PM
To: 'Midrange Systems Technical Discussion'
Subject: SQL descending primary key

All,

Is there no such thing as a _descending_ PRIMARY KEY in an SQL table?
If
that's the case, it surprises me. There will be HLL access to this
file.

I've used desc in SQL indices a number of times.

--
Jeff Crosby
UniPro FoodService/Dilgard
P.O. Box 13369
Ft. Wayne, IN 46868-3369
260-422-7531

The opinions expressed are my own and not necessarily the opinion of my
company. Unless I say so.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.