Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
The schema (row1) that is passed between tFixedFlowInput and tFlowToIterate components is row1.tableName, which carries the name of the table in the list.
The next component in the flow will iterate through the list and pass the table name to the next component which is a tDB2Input and this will perform a 'SELECT * FROM...' the table name that comes from the iterator.
The last component in the flow is the insertion into the target Database which is a tMSSqlOutput component and this will create the selected rows.
So I have the following questions:
1. How do I define a dynamic schema in the 'tDB2Input' component. Obvioulsy I do not know or can specify the schema at design time. I want the component to derive the schema name based on the table that it selects from ?
2. Can I specify 'row1.tableName' in the tMSSqlOutput component ?
Appreciate your help
Thanks
Patrice
1. How do I define a dynamic schema in the 'tDB2Input' component. Obvioulsy I do not know or can specify the schema at design time. I want the component to derive the schema name based on the table that it selects from ?
2. Can I specify 'row1.tableName' in the tMSSqlOutput component ?
1) Just select a Built-In schema in the tDB2Input component and then create a single column with a type of "Dynamic" for that. Then for the tMSSqlOutput component, do the same.
2) I don't believe you can specify row1.tableName in the tMSSqlOutput component's table name field. BUT you CAN use ((String)globalMap.get("row1.tableName")). This globalMap is set during the iteration, which is before the subjob containing the tMSSqlOutput component. Parameters like filenames and table names need to be in place before the component is first initialised in many cases.
You might also want to consider whether the tables already exist in your output database. If they don't then you will have to use "Create table if does not exist" in your output component's "Action on table" option.
Hope this helps.
Hi,
1- No dynamic schema with open source version.
2- As you have a tFlowToIterate, it's preferable to use the global variable created by this component.
You can retrieve the tablename using:
(String)globalMap.get("row1.tableName") // or an other name depending on the settings for tFlowToIterate
Hope this helps.
Thanks for the reply.
I am not using the Open Source Studio. I am using a Licenced version: 6.1.1.
Let me know
Thanks
1. How do I define a dynamic schema in the 'tDB2Input' component. Obvioulsy I do not know or can specify the schema at design time. I want the component to derive the schema name based on the table that it selects from ?
2. Can I specify 'row1.tableName' in the tMSSqlOutput component ?
1) Just select a Built-In schema in the tDB2Input component and then create a single column with a type of "Dynamic" for that. Then for the tMSSqlOutput component, do the same.
2) I don't believe you can specify row1.tableName in the tMSSqlOutput component's table name field. BUT you CAN use ((String)globalMap.get("row1.tableName")). This globalMap is set during the iteration, which is before the subjob containing the tMSSqlOutput component. Parameters like filenames and table names need to be in place before the component is first initialised in many cases.
You might also want to consider whether the tables already exist in your output database. If they don't then you will have to use "Create table if does not exist" in your output component's "Action on table" option.
Hope this helps.
Thanks Rob. That worked...
I have to perform a similar task. Where I need to loop through a list of tables in the same DB in SQL Server and output them to a MYSQL DB.
I was wondering why a "contexts." were added to the DB Information in the Input. Do I need to make a Contexts for this Sort of Job? Also what value does the Schema need in the input to perform this type of iteration,you mentioned "Dynamic" not sure if that is a datatype or an actual value.
I have to perform a similar task. Where I need to loop through a list of tables in the same DB in SQL Server and output them to a MYSQL DB.
I was wondering why a "contexts." were added to the DB Information in the Input. Do I need to make a Contexts for this Sort of Job? Also what value does the Schema need in the input to perform this type of iteration,you mentioned "Dynamic" not sure if that is a datatype or an actual value.
Help would be greatly appreciated,
Thanks,
Andrew