Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 !
Hi, you can use a tjavarow,
context.Stats1= input_row.NbUpgradeMerge1;
send me love and kudos
Hi you must use tdbinput with tjavarow to get the value of count.
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.
You probably ask your self, what is the purpose of the tDBRow component?
Thank you, for the answer.
Will try, if I need this again.