× 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: "David Morris" <dmorris@xxxxxxxxxxxxx>
  • Date: Wed, 17 Jan 2001 11:30:49 -0700

Brad,

This sounds like a bug to me.  If you run this in debug does it build a 
temporary 
work file when you make a selection?  That would make some sense.  From your 
messages, I gather you want the RRN to be the ordinal position within the group 
of 
selected records.  You can use a user defined function to do this.  

If this sounds like something you might want to do, the April 2000 Midrange 
Computing 
describes a sequence UDF.  The article is online at:

http://www.midrangecomputing.com/mc/article.cfm?titleid=a289&md=20004 

The code is online at:

http://www.midrangecomputing.com/ftp/prog/00/000408.zip 

David Morris

>>> bvstone@taylorcorp.com 01/16/01 08:12AM >>>
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


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