× 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: Passing parameters to QUERY/400
  • From: Mordechai Gluck <MGLUCK@xxxxxxxxxxxxx>
  • Date: Mon, 21 Dec 1998 17:41:13 -0500

Hi to all,

Here is my problem. I have a query that does record selection based on a
RANGE of values which always has to be changed by the user.  I would like to
automate the selection by running this job in batch called by a weekly pgm
which will automatically change the values based on certain conditions and
pass it to  the query. So I tried using the following code.

PGM        PARM(&IT1  &IT2  )                       
DCL        VAR(&IT1  )  TYPE(*CHAR) LEN(4 )         
DCL        VAR(&IT2  )  TYPE(*CHAR) LEN(4 )         
                                                    
STRQMQRY   QMQRY(MGLUCK/BLANCA2) ALWQRYDFN(*ONLY) + 
             SETVAR((IT1   &IT1  ) (IT2   &IT2  ))  
 
but the SQL engine isn't satisfied with a character field using RANGE as the
operator.  
This is the message I'm getting. - 
Message ID . . . . . . :   SQL0401       Severity . . . . . . . :   30     
Message type . . . . . :   Diagnostic
Message . . . . :   Comparison operator BETWEEN operands not compatible.

I tried the record selection with = operator  and it works. 
 
Any ideas will be greatly appreciated.
Thanks,
Mordy Gluck

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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-Ups:

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.