[resolved] how to get the column names in a data flow?
Hi
,
I'd like to know how to get the column names of a table in a flow of data: excel, delimited or postgresql.
I have to compare them to the ones I should use. It could be via a tMap component.
I must follow a strict naming plan for files and their fields...
Would you know how to get that?
Thanks,
Mathieu
Hi Feroz, Following code you can use in your tJavaRow...to get the column names to the context variable. for (java.lang.reflect.Field field: row1.getClass().getDeclaredFields()) { context.columnName = field.getName(); System.out.println("Field name is " + context.columnName ); } You can extend this code for your design... Vaibhav
Hello, I have the same problem: My job consists on doing the mapping of a XML file to a Csv file.But I want to have a second Csv file which contains the columns' names and types of the first. Do you have an answer please?? Thanks