Have any of you guys experienced that the DQuote function is not working properly inside a parallel transformer?
here "is not working properly" means that it is introducing extra escape characters. For example
mylink.mycolumn value is ABC"",""EFG
when I use Dquote(mylink.mycolumn) to enclose it in double quotes, and the desired output should be
"ABC"",""EFG"
however I am getting
"ABC\"\",\"\"EFG"
I noticed this after wasting 1 day and then finally I removed the Dquote function and instead I am using '"':mylink.mycolumn:'"' now.
here '"' is double quote inside single quotes.
A bug in Dquote function?
Moderators: chulett, rschirm, roy
That is exactly waht I do NOT want. I did not intend to treat it as two fields, I intend it to treat one field. It is coming as one field and I want it to leave the transformer as one field. I just want the incoming field enclosed in double quoted, that's all. I think that is the definition of this function
This is taken from the DataStage documentation ,
DQuote
Encloses a string in double quotation marks.
v Input: string (string)
v Output: result (string)
v Examples. If mylink.mystring1 contains the string needs quotes, then the following function
returns the string "needs quotes".
DQuote(mylink.mystring1)
Thanks
Chad,
This is taken from the DataStage documentation ,
DQuote
Encloses a string in double quotation marks.
v Input: string (string)
v Output: result (string)
v Examples. If mylink.mystring1 contains the string needs quotes, then the following function
returns the string "needs quotes".
DQuote(mylink.mystring1)
Thanks
Chad,
Then forget my whole assumption as to what you want, it was a guess on my part based on what the end result you wanted looked like. Still doesn't change my answer - in order to have quotes of the same type inside a quoted string, the internal quotes must be escaped. Nothing more than that going on.
Your solution is the appropriate one here, add them manually.
Your solution is the appropriate one here, add them manually.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There are two conventions when quoting strings that contain the quote character - either double them or escape them. So if the source data were ABC"",""EFG as you stated, the two possible results are "ABC"""",""""EFG" or "ABC\"\",\"\"EFG" when they are quoted. DataStage engineers have gone with the latter approach, probably because they're all C programmers and most from UNIX rather than Windows backgrounds.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.