What Is Difference Between SUBSTR and INSTR?: The Logic To Send Half Records From Flat File Source To Target Database
What Is Difference Between SUBSTR and INSTR?: The Logic To Send Half Records From Flat File Source To Target Database
What Is Difference Between SUBSTR and INSTR?: The Logic To Send Half Records From Flat File Source To Target Database
Comment!
INSTR function search string for sub-string and returns an integer indicating the position of the character in
string that is the first character of this occurrence.
SUBSTR function return a portion of string, beginning at character position, substring_length characters
long.SUBSTR calculates lengths using characters as defined by the input character set.
==============================================
This is Reddy Sekhar K, I have the source flat file which contain 3000 records, I want send half records, it means
first half 1500 records are load into the target; can anybody tell how can I achieve it?
Have an unconnected look-up on you source to get the count of the table when first records comes in
from source. Divide the count by 2. Also introduce a count variable to and increment it by one for each
records. In the filter transformation pass only the records where count is greater than the half the
value(total count divided by 2).
You can also use sequence generator to generate count.
If you have Unix, call the shell script as pre shell command, use the following command:
head -1500 filename > filename1
========================================================================
If you want to return multiple columns then go for Connected Lookup. When you are using
UnConnected
Lookup you cannot return multiple columns directly. So you need to Concatinate the Columns which you want to return
in to a single column and separate them in the expression after returning.
Unless you have any specific reason dont go for Unconnected when you expect multiple columns as output. As
Concatinating and separating may hamper the performance of the mapping.