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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert tOracle_input to tOracle_row for prepared statement with dynamic row

I have a tOracleInput with the following query

"SELECT * FROM VW_LATEST WHERE "+
DTC_EVENT_ID = "+context.event_id

 

This is inefficient and needs to be converted to a prepared statement using tOracleRow. However the output from the tOracleInput is a dynamic row. How can I convert from the object in tOracleRow to a dynamic row output?

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Not really what I was looking for as it still does the tOracleInput. I resolved it with a tJavaRow and processed the record set rather than the dynamic row.

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Hi,

 

    You can pass the output of tDBRow to a tFlowtoIterate component where the column name is called "query". In the tDBInput, use COntrol+Space to get this value under tFlowtoIterate component. When you select it, it will add to query section as shown below.

0683p000009M8Ak.png

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

Anonymous
Not applicable
Author

Not really what I was looking for as it still does the tOracleInput. I resolved it with a tJavaRow and processed the record set rather than the dynamic row.

Anonymous
Not applicable
Author

0683p000009M88G.png

 

TJavaRow has the following code

java.sql.ResultSet re_tParseRecordSet_3 = (java.sql.ResultSet) row7.dynamicRow;


boolean hasNextRecord_tParseRecordSet_3 = false;
saRowMap = ((java.util.Map<String, Object>)globalMap.get("saRowMap"));
globalMap.put("saRowMap", saRowMap);
int numColumns1 = re_tParseRecordSet_3.getMetaData().getColumnCount();
//System.out.println(numColumns1);
//System.out.println(saRowMap);
hasNextRecord_tParseRecordSet_3 = re_tParseRecordSet_3.next();
for (int i = 1; i < numColumns1 + 1; i++) {
//System.out.println(i);

String colName = re_tParseRecordSet_3.getMetaData().getColumnName(i);

if (!saRowMap.containsKey(colName)) {
Object colVal = re_tParseRecordSet_3.getObject(i);
// System.out.println(colName);
// System.out.println(re_tParseRecordSet_3.getMetaData().getColumnTypeName(i));
if ("DATE".equals(re_tParseRecordSet_3.getMetaData().getColumnTypeName(i)) && colVal != null){
colVal = TalendDate.formatDate("dd/MM/yyyy", (Date) colVal);
// System.out.println(colName);
}
// System.out.println(colVal);
saRowMap.put(colName, colVal);
}
}

RulesEngine.evaluateExpressions(saRowMap,
(List<java.util.Map<String, String>>)context.j902_exprList,
(List<java.util.Map<String, String[]>>)context.j902_paramList);

output_row.EVENT_ID = context.event_id;
output_row.STATUS_ID = 30;
output_row.INPUT_MAP = saRowMap;
output_row.CHANGE_USER = "TALEND";
//System.out.println(output_row);