top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Informatica shift field values to right

+1 vote
315 views

I want to create a mapping in Informatica Powercenter for the following functionality :

Initial Target Table Values : Field 1 : 100, Field 2 : 200, Field 3 : 300, Field 4 : 400.

Now, if the record is updated with a new value, say 500... then field 1 value should be moved to field 2.. and field 2 to field 3... and field 3 to field 4... and the new value should be inserted in field 1. so the output would be :

Field 1 : 500, Field 2 : 100, Field 3 : 200, Field 4 : 300.

How can I achieve above functionality?!

posted Nov 24, 2014 by Sachin

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

0down vote

The problem description is somewhat unclear, but it seems to be an interview question testing the knowledge of variable ports.

Refer to Prev column value display for a detailed explanation of port evaluation order. I will only reiterate two important points here:
1.The Integration Service evaluates ports in the following order: input ports -> variable ports -> output ports.
2.Ordering the variable ports properly is crucial, because the display order for variable ports is the same as the order in which the Integration Service evaluates each variable.

To solve the problem you need to define the a variable port for every input port with the following expressions:

in_Field1
in_Field2
in_Field3 
in_Field4

v_Field4 = v_Field3
v_Field3 = v_Field2
v_Field2 = v_Field1
v_Field1 = in_Field1

out_Field1 = v_Field1
out_Field2 = v_Field2
out_Field3 = v_Field3
out_Field4 = v_Field4
answer Nov 27, 2014 by Shweta Singh
Similar Questions
+1 vote

My source data

id    |   value
10       a,b,c
20       d,e,f

I want output is

id    |   value
10       a
10       b
10       c
20       d
20       e
20       f

How to do this scenario

0 votes

Suppose if we have duplicate records in a table temp_n. Now I want to pass unique values to t1 and duplicate values to t2 in single mapping? How can we achieve?

0 votes

I have a SQL transformation with 2 ports. I want to insert the value of these ports to a table, however I am getting an error from sqlError port.

Below is the query I am writing in the source qualifier:

INSERT INTO A values (~QC_CODE~,(~QUERY_STRING~));

The QUERY_STRING port contains a sql statement which is executed on Teradata and results have to be inserted in the table A.

If I replace the first port in the above query with a constant value, I get correct results. Below is the query that gives correct result:

INSERT INTO A values ('1',(~QUERY_STRING~));
+1 vote

I am using power exchange to read/write mainframe files through listeners, is it possible to handle low values/high values present in mainframe files through informatica ?

Thanks in advance.

+2 votes
PWX-00271 DBAPI Error. DB_READ failed for file <Non-relational source>.
PWX-01266 DBNTC Receive READ header for file <Non-relational source> failed, rcs 260/2011/2141.
PWX-02011 SQL fetch error. SQLCODE = 2141.
PWX-02141 Record mapping failure. Table="CIP.COMPBGRP.CIPCGHD2". Record=1. Row=1.
PWX-02142 Field extends past end of record.
                     Field="CIPCGHD2:GEN_AFT2_HEADER_AREA". Table="CIP.COMPBGRP.CIPCGHD2". Record=1. Row=1.

We are importing copy books from power exchange navigator and we are facing issue when we run query again the table and above error message we are getting.

...