Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with expression transformation - urgent !

Status
Not open for further replies.

vikind

MIS
Dec 11, 2003
58
US
Hi,
can anybody help me with this
I am using an expression and Router transformation i want to check if each source field is
NONE if it is 'NONE' then i want to set its value to NULL.

and if it is NULL for fields where NULL is not allowed i want to put those records

in an Error table (TB_ERR) and for fields where null is allowed i want to populate
those records in regular table (TB_VALID).

Feed layout:

Field Name DATATYPE valid values
--------- -------- ------------
STATE VARCHAR2(2) NOT NULL
BAN VARCHAR2(5) MAY BE NULL or BLANK
VERSION NUMBER(2,0) NOT NULL, NUMERIC ONLY

TARGET TABLES:
--------------

TB_ERR
TB_VALID

thanks in advance for your help !!

-vik
 
Hi Vikind,

As you know which columns are not nullable in the target table, i suggest the following approach:

Have an expression transformation A for which input ports are STATE and VERSION.
OUT_ERR = IIF((STATE='NONE' OR VERSION='NONE'),
'ERROR',
NULL)

This value goes into the router.

One of the input ports in router is like this:
IN_ERR = OUT_ERR
Router condition will be:
ERROR_TABLE: IN_ERR IS NOT NULL

This condition will populate TB_ERR table if STATE or VERSION is 'NONE' and TB_VALID in other cases.

hope this helps...
tkrish.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top