Flow variables

Hi,
I know how to pass a flow varibale along the work flow; however, this method does not work when the database query returns an empty data table. These the stpes I take in order to pass the flow variable along. 1) TableRow To variable Loop Start, 2) Database Reader, 3) variable To TableColumn 4) Loop End. This will not work though if the database query does not return any results. Is there A way to pass a flow variable along with an empty data table?


Thank you,
Giuseppa

 

Hi Giuseppa, 

I am not quite sure that I understand the workflow, but one small hint to get you started is that you can manually inject flow variables to any downstream node by dragging from the upper right corner of a node containing the variables of interest, to the upper-left corner of the node that you want to feed the variables to.  

I would also add that so long as the database reader executes, it is capable of providing an empty table and along with the table will come the variables associated with it. If the database reader is failing to execute, that is another story.

Regards,

Aaron

 

Hi Aaron,

Thank you very much.  yes, you are right. The reason why I was not getting any output  from the query is becuase the database component query was not getting the input.  It is true that as long as the query produces some result, the flow variables are moved along the work flow.  However, only  the inputs that match the database field and produce a result are passaed along the work flow.  Those inputs - in the column- that do not produce  a matching result are not passed along.  Could may be everything be passed using a global variable?

Best,

Giuseppa

 

 

Hi,

To be more specific, what I am looking for is a way to move the column query values that did not produce output as a result of the database query into the next component as well.  Some thing like a fail output port that can be suplied and concatenated to the matching results output table.  I am thinking that may be there is a way for the database component to concatenate the non-matiching query values to the flow variable that is being passed into the next component.  When I try to connect the upper rigt hand side componen containing the flow variable to the upper left hand side of the next component, it does not transfer all the records.

Regards,

 

Giuseppa

Hi Giuseppa, 

Sorry for being dense but I am still having a problem understanding the use case that you are proposing.  Would it be possible for you to edit the attached example to demonstrate your problem?  It should work so long as you have registered a jdbc sqlite driver (https://bitbucket.org/xerial/sqlite-jdbc/downloads). 


Regards,

 

Aaron

Hi Aaron,

Thank you for your response.  That is exactly what my work flow looks like.  The problem I am having is the following:

I use 10 input keys -1,2,3,4,5, 6,7,8,910 for the select query. The query is the following: "select A.source_name, B.source_year from A, B where something.A = something.B and A.source = ....................(list of source numbers from xls file);

Only source 1, 2, 3, 4, 5, 6, 7, are found in table A, while 8, 9 and 10 do not exist; therefore the source name and date in the query are not returned by the query;  But this is not the issue.

Input  file           Output table

Source   = 1,2,3,4,5,6,7,8,91,0      

 

I was hopping that  using a flow variable would return an output like the one belo

 

Source            Source Name               Year

1                        a                                     1345

 2                       b                                     1234

3                        c                                      1567

 4                       d                                     1899

 5                       e                                     1990

 6                       f                                       2220

 7                      g                                      2678

8                       ?                                         ?

9                       ?                                         ?

10                     ?                                          ?

Instead I get the following:

 

Source   Source Name            Year

 1               a                       1345

 2              b                      1234

 3              c                       1567

 4             d                        1899

5              e                       1990

6              f                         2220

7             g                          2678

In other words, 8 9 and 10 are not passed along by the flow variable (they are not appended to the resulting table).  I know I can use a joiner; but I was trying to avoid that. A joiner will not work if the joining variable records are not unique.  I know I can use injection in order to reuse the 10 original keys to query a different table; but the end result for the report will be that I have to use joiners.  I would like to avoid using a joiner or injection to pass the input along the workflow; but I would like to be able to pass all the input records directly from component to component.  Is there any way this could be done?

Best,

GiuseppaI

 

 

 

Aaron,

I though tabout the possibility of doing an outer join in the query, but -correct me if I am wrong- a left outer join would not return the left table keys that do not exist on the left table (non-matching keyes are non-matching because they do not exist in the queried table.  Is that right?

Thanks,

 

Giuseppa