• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » how to do conditions in talend

#1 2012-07-23 13:04:11

indira
Member
Registered: 2012-05-09
Posts: 125

how to do conditions in talend

Hi,

I have two input tables

row(table)                                                  row1(table
---------------                                              -----------------------------------------------------------

id                                                              id                        name
------                                                        ------------      ------------------
  1                                                              1                        check
  2                                                              1                         check1
15                                                              1                         default store
17
20                                                             2                          radha
23                                                             2                          latha
                                                                 2                          rani123456825

                                                                 15                        eee
                                                                 15                        www
                                                                 15                        yyyy455682




I joined two tables, if  row.id = row1.id
I just need migrate first row value(check,radha,eee),but I am getting (defaultstore, rani123456825,yyyy455682)
how to do this in talend.

Offline

#2 2012-07-23 14:29:44

djugal
Member
Registered: 2011-06-16
Posts: 229
Website

Re: how to do conditions in talend

hi indira,

there is 3 option of match model in tmap,
Unique match - it returns the last value matched ie (defaultstore, rani123456825,yyyy455682)
Fist Match - it returns the first value matched ie (check,radha,eee)
All matches - it returns matches all matches found

regards,
djugal

Offline

#3 2012-07-23 15:15:02

indira
Member
Registered: 2012-05-09
Posts: 125

Re: how to do conditions in talend

Hi djual,

Thank you.

I have one more doubt, first table is same  , second table i add one more column like this



-----------------------------------------------------------
     id                        name                            no
   ------------      ------------------                  --------------
     1                         check                             5
     1                         check1                           7
     1                         default store                   3

     2                          radha                            5
     2                          latha                             7
     2                          rani123456825               3


    15                        eee                                 4
    15                        www                                5
    15                        yyyy455682                     7


I just need 2 rows (check,check1) either of the column
based on the (no) column like this (no= 5) or(no=7)
how to do this in talend.

Offline

#4 2012-07-24 07:28:45

djugal
Member
Registered: 2011-06-16
Posts: 229
Website

Re: how to do conditions in talend

you can write if conditions in tgt schema in expression of column in tmap.
or u can use filter condition in tmap itself
i.e row1.no=5 || row1.no=7

Last edited by djugal (2012-07-24 07:29:26)

Offline

#5 2012-07-25 12:44:44

indira
Member
Registered: 2012-05-09
Posts: 125

Re: how to do conditions in talend

Hi djual,

Thank you

I have one doubt 

for example


row1(table) Input data
.......................................
num(column)       value(column)
..........................................
  28                     533011
  28                     533022
  28                     533033
  28                     533044

  24                     srnagr
  24                     hyd
  24                     kp
  24                     mp
  24                     pgt





I have two columns in a table based one the first column(num)all 28 rows ,The second column(value)all 533011,533022,533033,533044 data has to migrate to column in output table

i am using  this condition in out1 expreesion row1.num == 28 , the value column directly mapped out put value column

no errors, output i am not getting

how to do this in talend.

Last edited by indira (2012-07-25 12:55:31)

Offline

#6 2012-07-25 14:30:14

djugal
Member
Registered: 2011-06-16
Posts: 229
Website

Re: how to do conditions in talend

what is the output you are getting, can you show me a screen shot of ur job & tmap

Offline

#7 2012-07-26 05:54:24

indira
Member
Registered: 2012-05-09
Posts: 125

Re: how to do conditions in talend

Hi


I upload the screenshot image

Offline

#8 2012-07-26 07:15:23

djugal
Member
Registered: 2011-06-16
Posts: 229
Website

Re: how to do conditions in talend

cant see the screenshot

Offline

#9 2012-07-26 07:27:02

indira
Member
Registered: 2012-05-09
Posts: 125

Re: how to do conditions in talend

Hi,

I upload the images but it not display
plz can u provide the mail id

Offline

#10 2012-07-26 08:18:46

djugal
Member
Registered: 2011-06-16
Posts: 229
Website

Re: how to do conditions in talend

post reply > change upload slots to 1 from drop box > browse for the image

try once again

Offline

#11 2012-07-26 09:07:48

indira
Member
Registered: 2012-05-09
Posts: 125

Re: how to do conditions in talend

Hi

I upload the image

Offline

#12 2012-07-26 13:26:43

indira
Member
Registered: 2012-05-09
Posts: 125

Re: how to do conditions in talend

Hi djugal


I am trying to read data from MYSQL db and write them to PSQL db. In PSQLl db value field's data type is String(40), name fields's datatype is String(60). In Mysql DB value field's data type is String(255)

i got ERROR: value too long for type character varying(40)ERROR: current transaction is aborted, commands ignored until end of transaction blockERROR: current transaction is aborted, commands

I tried this one
Relational.ISNULL(row2.value)?"":row2.value.trim().length()<40 ?row2.value.trim():row2.value.trim().substring(0,39)
resolved error in output side


but i got ERROR: value too long for type character varying(255)ERROR: current transaction is aborted, commands ignored until end of transaction blockERROR: current transaction is aborted, commands

This is input side

Do you have any idea to solve this issue?

Offline

#13 2012-07-26 14:35:08

djugal
Member
Registered: 2011-06-16
Posts: 229
Website

Re: how to do conditions in talend

try increasing the size of the value field in the input component manually using built in type schema

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » how to do conditions in talend

Board footer

Powered by FluxBB