Can I get the table name from tOracleInput1

One Star

Can I get the table name from tOracleInput1

Is there a reference to get the table name being accessed by tOracleOutput_1?
I know there are references to get the input count calling tOracleOutput_1_NB_LINE_INSERTED. Is there something like tOracleOutput_1_TABLE_NAME?

The goal is to be able to pass the component name into a logging method and have it log the events against any table.
log("tOracleOutput");
....
public void log(String component) {
recordTableName = globalMap.get(component + "_TABLE_NAME");
recordInsertCount = globalMap.get(component + "_NB_LINE_INSERTED");
recordUpdatedCount = globalMap.get(component + "_NB_LINE_UPDATED");
}
One Star

Re: Can I get the table name from tOracleInput1

Inside the globalMap there is no such information available.
But you can use a workaround. Giving you know the table output component name (it will be the parameter of your log function):
1. Add a tJavaFlex after your output connecting both with the main flow:
tOracleOutput ---> tJavaFlex
2. In the end part of the tJavaFlex, you can have access to a variable that will contains the table name. Send the value of that variable as a parameter to your log function:
log("tOracleOutput_1", tableName_tOracleOutput_1);

3. Then you can write your function as:
public void log(String component, String table) {
recordTableName = table;
recordInsertCount = globalMap.get(component + "_NB_LINE_INSERTED");
recordUpdatedCount = globalMap.get(component + "_NB_LINE_UPDATED");
}
One Star

Re: Can I get the table name from tOracleInput1

Thanks for the suggestion. I'll give that try.