Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Write NB_LINE_INSERTED to database

I'm parsing a CSV file and writing it to SQL using tMSSqlOutput - this works fine.  I'd like to capture the NB_LINE_INSERTED value and insert that into an additional log file.

 

1.  I assume I should trigger  "On component OK" but I cannot "connect" that to another tMSSQLOutput control or to a tMap control.- what should me next "step" be after the database write to catch the variable and then write that to another table?  

2. Is there a best practice or tutorial on logging various jobs' activity?

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello,

The global variables of NB_LINE_INSERTED, NB_LINE_UPDATED and NB_LINE_DELETED are available in the whole job. You can populate the number of lines of inserted, updated data by using tfixedflow component

The work flow looks like:

Main job
...
  |
onsubjobok
  |
tFixedFlowInput(input: receive the global variables.)-->t<DB>Output

tFixedFlowInput: pass the global variables to your DB

Let us know if it is OK with you.

0683p000009LwZv.png

Best regards

Sabrina

View solution in original post

5 Replies
Anonymous
Not applicable
Author

There several ways of doing this. Not sure if there is a best practice scenario from which to work. 

 If you are looking to capture processing details of a job. I would first suggest to think about the data elements you want to capture. The way I have done this is to use the row generator ( 1 row only). 

Basically, once the job has completed, either a oncomponent or onsubjob then connects to the row generator. this captures the information I need to save to my log table (this includes to the number of rows read from source and number inserted into the destination table) (See attached pics) . This then writes out to the database on a Different SQLoutput connection. 

 

 


jobflow.jpg
rowgenerator.jpg
Anonymous
Not applicable
Author

Hello,

The global variables of NB_LINE_INSERTED, NB_LINE_UPDATED and NB_LINE_DELETED are available in the whole job. You can populate the number of lines of inserted, updated data by using tfixedflow component

The work flow looks like:

Main job
...
  |
onsubjobok
  |
tFixedFlowInput(input: receive the global variables.)-->t<DB>Output

tFixedFlowInput: pass the global variables to your DB

Let us know if it is OK with you.

0683p000009LwZv.png

Best regards

Sabrina

Anonymous
Not applicable
Author

That worked perfectly, thanks Sabrina!
Anonymous
Not applicable
Author

Hello,

Great it works. Thanks for your feedback.

Best regards

Sabrina

Remoz-83
Contributor
Contributor

Hi,

 

I'm trying to do the same but i get an error saying "Error in the component's properties:tFixedFlowInput_1 cannot be resolved to a variable", what I'm doing wrong?

 

please see attached file


2019-11-19 12_50_41-Window.png