× 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.



As I see it, an OPNQRYF is more like the old logical file. If you use the KEYFLD parameter, you have a keyed logical. Whether you choose to use it as keyed depends on you - use 'K' on your F-spec, other ways in other languages.

The expression "non-keyed view" is redundant, in a way - a view never has a key. If you do a DSPFD of a view (try DSPFD QSYS2/SYSCOLUMNS), you will see "SQL file type" = VIEW, and then the CREATE VIEW statement that was used. That contains a SELECT statement. My observation is that the system runs that statement each time you use the view, even when you use it in RPG.

Also, if you look further down, it shows the "Access path" to be "Arrival" - yes, Martha, non-keyed files have an access path, too. ;-)

As to a view being sequential, yes, maybe. But not guaranteed to be the physical ordering. If you have various parallel processes working on returning the data, results are unpredictable - different subsets can arrive anytime. Look at the SQL (Database) performance & optimization manual for more on access methods used by the SQL optimizer.

You CAN use an index in RPG - but you get no field selection, just order. You CAN use a view in RPG - but you get only field selection (albeit with possible calculated expressions, more flexible joining possibilities,etc.).

Clear as mud? Very thin mud?

HTH
Vern

At 12:30 AM 6/19/2005, you wrote:

now I am confused again.  Isn't a non-keyed view treated as a sequential
file?  In this scenario wouldn't a non-keyed view be more similar to an
opnqryf?



---------------------------------

Booth Martin

http://www.martinvt.com

---------------------------------

-------Original Message-------



From: Midrange Systems Technical Discussion

Date: 06/18/05 13:00:45

To: Midrange Systems Technical Discussion

Subject: Re: DBA Question



Hi Jack,



Others have highlighted quite a few of the similarities/differences. My own

view (pardon the pun) is that it depends on how you intend to use them.



If you are talking about developing a DB that will be accessed primarily by

SQL from many different sources, then Views and Indexes. If it is primarily

for RPG, then views, indexes and logical files.



At its simplest, an index is a keyed logical and a view is a non keyed

logical. From an RPG angle the problem is with the views - even they are a

lot more powerful then DDS created logicals they are of little use in RPG

since they do not have a key - so only useful if using embedded SQL.



FWIW, I did an article on comparing DDS and SQL's DDL on search400 at

http://search400.techtarget.com/tip/1,289483,sid3_gci1021854,00.html?FromTax

onomy=%2Fpr%2F2f9



HTH



Paul Tuohy



----- Original Message -----

From: "Jack Derham" <derhamj@xxxxxxxxxxxxx>

To: "'Midrange Systems Technical Discussion'" <midrange-l@xxxxxxxxxxxx>

Sent: Saturday, June 18, 2005 3:40 AM

Subject: DBA Question





> To the List,







> Got into a discussion this afternoon about what the real differences are

> between logical files, views and indexes. The discussion got a little

heated

> at times so I would ask that some of you well versed members to please

help

> out less fortunate uninformed members about the real physical and logical

> attributes of these object types.







> Jack Derham



> Direct Systems, Inc.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.