Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
gt0731
Contributor III
Contributor III

How to - Loop through ID's in Insert query columns

Hi Everyone, 

I would like to Loop through mulitple ID column for sql table via Insert query. 

Curious - What will be design of Job for looping Inset SQL 

Here is the Insert statement that I want to loop for Columns req_id , driver_id

driver id is 36 ,37, 38.39 always fixed for Paticular action called X .

for Particular action X driver ID is fixed four number.

similarly,

we have Y action for driver_id 33 ,34,35,36 is fixed number

INSERT INTO audit_tbl

 req_id,

col2,

col3,

 col4,

 col5,

 col6,

 col7,

 driver_id,

 col8,

 col9

)

VALUES

(

 1294887,       

 '2020-10-05 00:00:00',

 '',

 '2020-10-05 00:00:00',

 '2020-10-05 00:00:00',

 -1,

 'N',

 36,  

 0,

 0

);

 

 

We tried

I am trying to think in this direction

 

 

 

Job design - Are this design feasible in this situation

tmsinnput >>tflowtoiterate >> tjava >>tforeach / tloop (for min, max driver_id) >>tmssqlrow 

or

receive request table select input >> iterate for request id >> process condition if action O >> loop for min max driver ID records >> execute insert query in audit table 

Labels (3)
4 Replies
Anonymous
Not applicable

Hi

You want to loop 4 times for each req_id that read from the input table? I don't understand ' process condition if action O', I think I need more information to help you out.

 

Regards

Shong

gt0731
Contributor III
Contributor III
Author

Here we have 4 actions( O, UO,UF,F) available foreach we have four driver ID exist

Anonymous
Not applicable

How the actions come from? They are read also from input table?

 

gt0731
Contributor III
Contributor III
Author

Action sql server table exist. after process creation I have to point this child job into context that is i have to run from Parent job.

Not able to run. can you please help me in pointing the job