
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
'null' value with a tDBRow to count a number of lines
Hi everyone,
I try to execute a SQL query with a tDBRow component to count the number of rows of a table and send it by mail, as a statistic.
Example of the Query :
select count(*) AS NbUpdateMerge1
from myTable
where ...
So I use an alias and try to identify the wanted data.
I use a field in my tDBRow schema to store the field identified by the alias :
After, I use a tJava (or tJavaRow) component to store the value in a context variable :
context.Stats1 = row5.NbUpdateMerge1;
When I execute, the result is a null value, instead of the real value. Why ?
For information, if I use a tDBInput instead of the tDBRow, it works !

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, you can use a tjavarow,
context.Stats1= input_row.NbUpgradeMerge1;
send me love and kudos

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi you must use tdbinput with tjavarow to get the value of count.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The component tDBRow does not provide out-of -the-box the resultset. You have to activate that in the advanced settings.
Once you have activate this option you need to assign the resultset to an output column of the flow.
Next you have to use tParseRecordSet to get the values and tParseRecordSet will also open the actual loop over the result set in case there are more than one row in the result set.
You can also use the incoming flow columns together with the outgoing columns.
But take care, if your resultset does not provide records you will get no output row by the tParseRecordSet.
Conclusion: in your case it should be easier to use a normal tDBInput.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You probably ask your self, what is the purpose of the tDBRow component?
- Running any statement even it is not an select
- this component can be used within a flow and can take over values from an incoming flow to tweak the select
- this component is unfortunately the only one can handle prepared statement parameters (see also in the advanced settings)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, for the answer.
Will try, if I need this again.
