DB2 Select on a large number of rows/
5 pts.
0
Q:
DB2 Select on a large number of rows/
SQL, DB2, JCL
I have to run a DB2 against a number of table for example tableA, tableB and select a number of fields from the table. However, I have to run the selection against 5,000 records that. I want to know if using SQL embedded in a JCL, if I could plug in a file with the
records I want to select for example

MyFile: Contains the records I want to select

SELECT A.FELD1, A.FIELD2, B.FIELD1, B.FIELD2
FROM tableA A, tableB B
where A.acc = b.acc
AND a.acc in ( <myFile >)
ASKED: Aug 22 2008  3:52 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
1840 pts.
0
A:
 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0
  • AddThis Social Bookmark Button
you say "using SQL embedded in a JCL" which leads me to think something like DSNTEP2. So the answer is that I am unaware of anyway to do this with a file. HOWEVER, you could use a DB2 table.

SELECT A.FELD1, A.FIELD2, B.FIELD1, B.FIELD2
FROM tableA A, tableB B
where A.acc = b.acc
AND a.acc in ( select column1 from my_table) <---

Steve
Last Answered: Sep 22 2009  2:11 PM GMT by Meandyou   1840 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0