MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

QMF SQL Contains Variable

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Elster
Beginner


Joined: 24 Jan 2008
Posts: 5
Topics: 2

PostPosted: Wed Jun 04, 2008 7:13 am    Post subject: QMF SQL Contains Variable Reply with quote

Good day.

Using QMF for Windows, trying to run a query where the user will enter in a value, and the results will be one column which contains the entered value ANYWHERE in that column.

Code:
SELECT
A.ITEM1_DESC
,A.ITEM_NBR
,A.ITEM_SERIAL_NBR

Q9FRARM.FIREARM A
where
(A.item_serial_nbr CONTAINS &SerialNumberinsinglequotes)


The above does not like the CONTAINS verb.

When executing the above, It brings up a panel to enter the variable field. This value would be entered as

'ABCD'

The query should check all instances of A.item_serial_nbr, and return all records containing ABCD anywhere in the data.

Results:

ABCDEFG
XYZABCD
RAYABCD1234


I have checked several manuals, tried numerous variations of the above, and asked several team mates with no success. Appreciate your assistance.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Jun 04, 2008 7:41 am    Post subject: Reply with quote

Can you do something along the lines of:

LIKE '%'||hostvar||'%'

?
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Elster
Beginner


Joined: 24 Jan 2008
Posts: 5
Topics: 2

PostPosted: Wed Jun 04, 2008 10:13 am    Post subject: Reply with quote

It must have been the (hic) BARS.

We tried the % and single quotes, but not the BARS (hic) bonk bonk

Fantastic - many thanks!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group