TALEND UPDATE FILA

1

Good, I am updating a database from a .txt file, specifically I am updating the following values.

With the tmap I make the corresponding relation between the data of the .txt and the attributes of the database and then I do the update in a sqlserver database, where it says "machine".

My problem is that I am always updating the DB, even if the data I received from the .txt is blank. Basically, the row "transaccio" I only want to update it in the database when it has a field of type "date" or simply contains some data.

I am sure that with the TMAP there is some way to make it only put into the database when there is something but I do not know how to do it.

    
asked by talendguy 17.03.2016 в 09:26
source

1 answer

1

Good morning. in Tmap you have the option of Nullable . If you uncheck the option, you should not obtain records from a file with cell NULL , and only obtain the relevant data. Another way is to enter a tfilterow and filter exclusively in the columns that have any type of data, and thus you will get that only what has data is integrated into the database. I hope it serves you, greetings. You can also create a routine:

 public static String yumeteo(String dato)
    {                 

     {
            try {

            if (dato.compareTo("")!=0){                 
                return "Vacio"
            }catch (Exception ex)
            {
                return "KO";

with this you get that in the empty cell put "Empty" and with a textractregexfields you can get all the rows that have this String and exclude it from the load. I hope it helps you

    
answered by 23.01.2017 в 18:00