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

Can we use array in where clause of select statement?


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

New User


Joined: 18 Apr 2006
Posts: 22

PostPosted: Tue Dec 11, 2007 4:14 pm
Reply with quote

I want to know is it possible to use array (an integer array) in the
where clause like,

SELECT
......
INTO
....
FROM
...
WHERE
...
TABLE.COL_NAME IN :WS-INT-ARRAY


If yes how to code it.
Back to top
View user's profile Send private message
vijayakumar.yellala

New User


Joined: 19 Apr 2006
Posts: 63
Location: Chennai

PostPosted: Tue Dec 11, 2007 4:25 pm
Reply with quote

you can use....

but not like, table.column name

directly u can use column name inthe Where clause
Back to top
View user's profile Send private message
dr_te_z

New User


Joined: 08 Jun 2007
Posts: 71
Location: Zoetermeer, the Netherlands

PostPosted: Tue Dec 11, 2007 4:32 pm
Reply with quote

No. You must redefine. BUT! That's where session tables come in.
Code:

where colonm_a in (select a from session.temp_tab)
So, instead of a cobol array you drop/create/populate a session tempory table. Very powerfull.
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 Dynamically pass table name to a sele... DB2 2
No new posts SELECT from data change table DB2 5
No new posts Select two different counts from SQL... DB2 6
No new posts To search DB2 table based on Conditio... DB2 1
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
Search our Forums:

Back to Top