space_animal
space_animal

Reputation: 13

How can I plug in this simple SQL logic to an already existing script correctly?

Currently I am working on a sql script in informatica powercenter, the current script is this

ltrim(rtrim(Sur_Co))||

ltrim(rtrim(Seqe_N))||

rpad(ltrim(rtrim(Ct_Num)),30,' ')||

**iif(isnull(ltrim(rtrim(ent_Tx_ID))),rpad(' ',20,' '),
rpad(ltrim(rtrim(ent_Tx_ID)),20,' '))||**

**iif(isnull(ltrim(rtrim(ent_Tx_ID_Q))),rpad(' ',2,' '),
rpad(ltrim(rtrim(ent_Tx_ID_Q)),2,' '))||**

ETC

I dont need the iif is null logic for ent_Tx_ID and ent_Tx_ID_Q anymore, I just need to always give the value of empty spaces for these two columns specifically like this,

**ent_Tx_ID = RPAD(' ',20,' ')
ent_Tx_ID_Q = RPAD(' ',2,' ')**

how would I edit this logic into that script?

Upvotes: 0

Views: 55

Answers (1)

Jim Macaulay
Jim Macaulay

Reputation: 5155

You can use below concatenations directly in informatica,

ltrim(rtrim(Sur_Co))||
ltrim(rtrim(Seqe_N))||
rpad(ltrim(rtrim(Ct_Num)),30,' ')||
' 20 ' || ' 30 '

Upvotes: 0

Related Questions