How to append the column
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 25
- Joined: Sun Oct 23, 2005 12:55 pm
How to append the column
Hi,
I have one ODBC stage Transformer and Sequential file
there is a column (PRODID) in ODBC and i want to keep
a character 'x' appended for every row
how should i add character in starting of that record
it should look like this
ODBC = 12345
Transformer= x+12345
Sequential file = x12345
I have one ODBC stage Transformer and Sequential file
there is a column (PRODID) in ODBC and i want to keep
a character 'x' appended for every row
how should i add character in starting of that record
it should look like this
ODBC = 12345
Transformer= x+12345
Sequential file = x12345
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
In the derivation of the column PRODID, concatenate 'x' to the value.
Whale.
Code: Select all
x:InLink.PRODID
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
-
- Participant
- Posts: 25
- Joined: Sun Oct 23, 2005 12:55 pm
THANKSI_Server_Whale wrote:In the derivation of the column PRODID, concatenate 'x' to the value.
Whale.Code: Select all
x:InLink.PRODID
W H A L E ..................
-
- Participant
- Posts: 1
- Joined: Thu Jan 04, 2007 6:18 pm
- Location: London
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
IMHO Whale's solution is much more readlable and easy to maintain - if You have a complex query then it's hard to see the concatenation and You end up wondering: "Why the hell do I have these strings here?".
If You do it in Transformer You can give it a name "AppendX" and at a glance You know that something happens there - double-click and You know all the details.
If You do it in Transformer You can give it a name "AppendX" and at a glance You know that something happens there - double-click and You know all the details.
Regards,
Wojciech Nogalski
Wojciech Nogalski
Gurus,
This solution of x:col is gonna return a NULL value if the value of col is NULL.
i have 3 cols to be concatenated say x,y,z.
If isNull(x) then ' ' else x : If isNull(y) then ' ' else y : if isNull(z) then ' ' else z
this condition does not return the value of z ,if the y becomes a NULL value.
How do you solve this?
Thanks,
Murali
This solution of x:col is gonna return a NULL value if the value of col is NULL.
i have 3 cols to be concatenated say x,y,z.
If isNull(x) then ' ' else x : If isNull(y) then ' ' else y : if isNull(z) then ' ' else z
this condition does not return the value of z ,if the y becomes a NULL value.
How do you solve this?
Thanks,
Murali