IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we use a COBOL group variable in an SQL "IN" c


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Wed Nov 01, 2006 6:27 pm
Reply with quote

Hi,

Both the queries are same. We can very well use a group variable as parameter for IN. It is equalant of using invidual variables.

Thanks,
Reddy
Back to top
View user's profile Send private message
Yoyoyo

New User


Joined: 19 Sep 2006
Posts: 26

PostPosted: Thu Nov 02, 2006 5:18 pm
Reply with quote

surya_pathaus,

The code is working fine for me.

01 VARS
05 VAR1 - '01'
05 VAR2 - '02'
05 VAR3 - '03'
05 VAR4 - '04'

When I use the query,
Code:

SELECT *
FROM table
WHERE field1 IN (:VARS)

and I get the rows from table where field1 is either '01' or '02' or '03' or '04'!!!

Any more clarifications required? Do lemme know.

yoyoyo!


[/code]
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top