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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
BendingUnit22
Contributor
Contributor

Using Oracle DBInput Query Columns in other components

Just starting with Talend and seem to have run into an issue I just cant seem to get. I have an OracleDBInput that uses a query to select 3 columns from the DB.

DBName (vchar)

OwnerName (vchar)

TableName (vchar)

 

ex.

"select DBName, OwnerName, TableName

from test_table
where ACTIVE in ('Y','T')
and SOURCE_OWNER = 'PAYROLL'
and SOURCE_TABLE like 'PT%'"

 

Then I pass the row output to a tDBRow that will run a query that will use the data from 2 of the 3 columns and run it.

"select dbms_metadata.get_ddl('INDEX', index_name, owner)
from all_indexes
where owner = 'OwnerName'
and table_name = 'TableName '"

 

i have tried things like this:

and table_name = '" +((String)globalMap.get("tDBInput_1_TableName "))+"'"

and table_name = '" +((String)globalMap.get("row1.TableName "))+ "'"

and table_name = '" +row1.TableName+ "'"

 

I did get a few runs without an error but i could not figure out how to display the results in the tlogrow to verify.

I did try the tParseRecordSet but seem to have problems with the object type conversion to something I could see in a tlogrow also.

 

Then when I get that first part working I would like to store / pass  the result and use it after a drop and create in a DBOutput.

I think I would use the tsetglobalvar for this but i have the first issues to get through.

 

Basically i am trying to generate a index create script for an individual table that comes from a table listing several that i need to get this for.

 

Hope this makes sense.

 

Thanks for any insight you can provide.

 

Labels (3)
2 Replies
vapukov
Master II
Master II

Hi,

 

by default tDBRow do not return result, it mostly for run DDL or DML queries

you can use tDBInput instead - there you can use your SQL query, just define a schema and connect it to future components

 

cheers

BendingUnit22
Contributor
Contributor
Author

Well that did the trick.

Thanks for your help.