Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am pretty new to the talend tool. I am attempting to use a dynamic schema with TDBINPUT component to move more than 300 tables from SYBASE IQ server to SQL server database .
However I have a problem with tables which contain numeric columns as data type in sybase IQ
The components i used
TDBINPUT-----> tlog row
with tdbinput component i set a dynamic schema.
as a results:( java.lang.NullPointerException)
I noticed when I try to load a table which does not contain numeric column data from sybase, it works well
the same problem when i created the metadata connexion to Sybase IQ i can't get connexion.
Talend version: ENTREPRISE VERSION 7.2.1
Sybase IQ version: SAP IQ/16.0.110.2337/10364/
Cordially
I'm afraid I have not seen this issue and do not have access to a Sybase IQ server at the moment. So can I ask you to try something out?
The code below should be placed into a tJavaFlex after your tDBInput. You will need to tweak the row and the column name in the code to match your row and dynamic schema column name.
This section should go into the Start Code....
// start part of your Java code
//Column count variable to count dynamic schema columns processed
int columnCount = 0;
//Row variable to count rows
int row = 0;
....and this code should go into the Main Code....
// here is the main part of the component,
// a piece of code executed in the row
// loop
row++;
System.out.println("Row number = "+row);
if(columnCount==0){
//Set the dynamicColumnsTmp variable
Dynamic dynamicColumnsTmp = row2.newColumn;
//Cycle through the columns stored in the Dynamic schema column and add the column names
//to the ArrayList
for (int i = 0; i < dynamicColumnsTmp.getColumnCount(); i++) {
DynamicMetadata columnMetadata = dynamicColumnsTmp.getColumnMetadata(i);
System.out.println(columnMetadata.getName()+"|"+columnMetadata.getType()+"|"+dynamicColumnsTmp.getColumnValue(i));
}
//Append 1 to the rowCount
columnCount++;
}
columnCount=0;
System.out.println("");
What this will do is tell you what the dynamic schema is identifying. So you will see a row for every column. Each column will have a name, a type and a value. You will get a row for each column in your data row and will get this for every data row. The data rows will be separated by a line break.
Take a look at this and see if it gives you any more info which you can pass on.
FYI, this code may be useful for other bits and pieces as well.
Hi,I can't run the code, because the job faild at first component DBINPUT, there no data which passe to tJavaFlex .
Maybe is the bug, with talend version V7.2!
OK, I think it would be a good idea to raise this with Support. I'd need to have a play around to figure this one out. Sorry, I can't help more.