DB2 Select on a large number of rows/

5 pts.
Tags:
IBM DB2
JCL
SQL
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 >)

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following