-1

I would like to create a job than based on some values in Table A, execute a Select query in Table B where the WHERE CONDITION must be parametric.

For example: I have 10 columns in A with 100 rows filled. 9 of my columns can be nullable so I have to create a query that controls the nullability of a value, if null then it must NOT be considered a research criteria in the Select statement.

I thought about using a SPARSE lookup where I'd pass a string that I created with the concatenation of the research parameters if they're not null but the job fails because you need to map the columns.

I even created a file with queries as string and then I loop the file and pass the string as a variable for the DB2 connector stage. It works... but I have more than 10000 rows means 10000 queries.. not that fast.

Thanks for your help.

PS: I'm new to this stuff :D

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ahmed
  • 1

1 Answers1

0

what you can do is to use Before SQL option at your source/target stage. Namely, your job will have at least two stages. One source db2 stage and one copy or sequential or peek stage as target or Row generator and target db2 connector.

In your input db2 connector you can pass your sql script as parameter into before sql provided that it is generated in advance and pass it as value to your before sql of db2 connector. Your actual sql statement will use "dummy" script such as "select current date from sysibm.sysdummy1" to complete your execution.

Hope it makes sense.

Ozgur G
  • 26
  • 4