Celebrating 10-Years of SQL Performance Excellence

With defining an DDS LF you just can get the total of records from the 
FileInfoDS.
Since this is a NonKeyedLogical you will not get a lot of DBManager handling in 
every change in the dependent PF (will only be something to think about in real 
big files and long logical key's).
But ever remember lesson one in DB design. 
The moment you need more then 10 views over an PF....... 
You did something wrong in an earlier stage.
Go back to the drawing board and do it better.

Eduard.

----- Original Message ----
From: Luis Rodriguez <luis.rodriguez2@xxxxxxxxx>
To: Midrange-L <midrange-l@xxxxxxxxxxxx>
Sent: Tuesday, March 27, 2007 9:55:42 AM
Subject: Re: Getting the number of records in non-keyed logical files?


Elvis, Rick:

Thanks for your answers.

  That's what I thought of, although there is (was?) always hope :-) …  


  I wonder what would be faster, using a DDS-based LF or Elvis' proposed 
solution? This CL is executing a 5 sec. loop, and I wanted to avoid the 
sequence of CALL/Open Cursor (or file), etc. 


    Thanks again, 


  Luis Rodriguez


midrange-l-request@xxxxxxxxxxxx wrote:------------------------------

message: 9
date: Tue, 27 Mar 2007 08:11:56 -0500
from: 
subject: RE: Getting the number of records in non-keyed logical files?


Luis,

Because views are merely SQL statement containers there are no records to 
count.  Each time the view is accessed the SQL statement is executed to 
retrieve the resulting data set.  To get the number of records you will need to 
count the number of records returned by the SQL statement contained in the view 
as posted by Elvis.

Rick

-----Original Message-----
On Behalf Of Elvis Budimlic
Sent: Monday, March 26, 2007 11:17 PM
To: 'Midrange Systems Technical Discussion'
Subject: RE: Getting the number of records in non-keyed logical files?

I realize it's not purely CL solution, but if ILE is not out of the realm of 
possibilities doing a CALLPRC to a module written in HLL with embedded SQL 
following statement would be my choice:

SELECT COUNT(*) FROM YOURVIEW

Elvis

Celebrating 10-Years of SQL Performance Excellence

-----Original Message-----
Subject: Getting the number of records in non-keyed logical files?

Hi all,

Does anybody know how to get the number of records in non-keyed logical files 
(e.g. SQL views)?

RTVMBRD / NBRCURRCD can only get the number of records for keyed LFs. I would 
like to determine, in a CL program, the number of records in a SQL view.


Thanks,

Luis Rodriguez



Luis Rodriguez

IBM Certified Systems Expert
eServer i5 iSeries Technical Solutions

---------------------------------
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.