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


  • Subject: RE: SQL Mystery?
  • From: "Stone, Brad V (TC)" <bvstone@xxxxxxxxxxxxxx>
  • Date: Tue, 16 Jan 2001 09:12:46 -0600

No, I'm not really looking to order by RRN.
 
Let me see, how can I word this.
 
If I use STRSQL and run the statement:
Select RRN(a), a.* from CSTMSTPF where CSZIP <> '58201' order by CSZIP
 
I get the _real_ RRN in the results.
 
If I use dynamic SQL in an RPG program (CGI program actually) and use a cursor, the RRN returned is not the real RRN of the PF, but the RRN of the subset of records.  So the first record has an RRN of 1, the second, 2, etc.. etc..
 
Could it be because I am PREPAREing and DELCLAREing a cursor (as dynamic scroll)?  Not sure.  I'd be interested to know for sure. :) 
 
Help any more?
 
Brad
-----Original Message-----
From: dmosley@dancik.com [mailto:dmosley@dancik.com]
Sent: Tuesday, January 16, 2001 8:30 AM
To: RPG400-L@midrange.com
Subject: Re: SQL Mystery?

Insert " ORDER BY RRN(CSTMSTPF)" in your statement.  This will allow you to put it in RRN order.  And then if you want a selected set, add a "WHERE RRN(CSTMSPF) BETWEEN 1 AND 50", or you use a <= , or something else to select your range.

 

I hope this was what you where asking for.

 

 

David L. Mosley, Jr.
Dancik-On-Disk International, Ltd.
401 Harrison Oaks Blvd., Suite 101
Cary, NC 27513
919-677-0005

+--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---

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.