Suppose, you have Oracle as a source and you need to do data profiling and needs to be loaded in target.
Write a source qualifier query to eliminate invalid data because joining tables in Database is efficient than joining using joiner transformation in informatica.
To check whether the incoming field is numeric or non-numeric, we can use TRANSLATE function in oracle. I cannot say this is the only way to do data profiling but this is one of the ways to do data profiling.
Syntax:
TRANSLATE (string, String_old, String_new)
This function will replace the string_old characters with string_new characters. Suppose, if you give
TRANSLATE (‘1234’,’14’,’98’), then this function will replace 1 with 9 and 4 with 8. The result will be 9238.
With the below query, we can check whether the incoming filed is numeric or non-numeric.
SELECT LENGTH (TRIM (TRANSLATE ('1234','0123456789',' '))) FROM DUAL
If the above is giving NULL then that input value is NUMERIC.
If the above query is giving NOT NULL value then that input value is Non-Numeric.
Note: In oracle, TRIM(‘ ‘) {TRIM of SPACE or EMPTY} will give you NULL value.
Example (For Numeric field) :
This Article was written by K Krishna Reddy (kkrishnareddychp@gmail.com)
Comments
Post a Comment