× 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: Thu, 18 Jan 2001 07:34:56 -0600

I'm a dope (but don't do dope).

I had a total brainfart while looking at this.  I am using an internal
counter, but the field name for this is close to the RRN field that I was
using to store the real RRN so I got messed up in da head.  It works as
advertised, and I'm doing it the way I thought I shoulda been doing it.  No
bugs.

Sorry for all the confusion.  But I bumped into my mid-life crisis a week or
so ago and I think he's comin back.  :)

Brad

> -----Original Message-----
> From: David Morris [mailto:dmorris@plumcreek.com]
> Sent: Wednesday, January 17, 2001 12:31 PM
> To: RPG400-L@midrange.com
> Subject: RE: SQL Mystery?
> 
> 
> 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
> +---
> 
+---
| 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.