String Handling
Moderators: chulett, rschirm, roy
String Handling
Hi all.
Some of the coulmns in a file needs to be in double quotes (say string data type columns) and the rest are not to be in the quotes. So is there any way of doin this?
I know one solution that we can suprees the quote character and then concatenate the quotes in the transformer coulmn level derivation wherever we want (i mean in the column level derivation of transformer). Is this only way of doing it or any thing else there?
If so kindly help me.
Your time would be highly appreciated.
Thanks in advance
Veera
Some of the coulmns in a file needs to be in double quotes (say string data type columns) and the rest are not to be in the quotes. So is there any way of doin this?
I know one solution that we can suprees the quote character and then concatenate the quotes in the transformer coulmn level derivation wherever we want (i mean in the column level derivation of transformer). Is this only way of doing it or any thing else there?
If so kindly help me.
Your time would be highly appreciated.
Thanks in advance
Veera
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
An example of your output data here would be useful.
If you simply require varchar to be quoted and numerics to be not in a sequential comma seperated file then set the quotes setting to "
Alternatively you could simply have 1 output string a varchar 9999 for example in which you construct your entire string.
If you simply require varchar to be quoted and numerics to be not in a sequential comma seperated file then set the quotes setting to "
Alternatively you could simply have 1 output string a varchar 9999 for example in which you construct your entire string.
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
An example of your output data here would be useful.
If you simply require varchar to be quoted and numerics to be not in a sequential comma seperated file then set the quotes setting to "
Alternatively you could simply have 1 output string a varchar 9999 for example in which you construct your entire string.
If you simply require varchar to be quoted and numerics to be not in a sequential comma seperated file then set the quotes setting to "
Alternatively you could simply have 1 output string a varchar 9999 for example in which you construct your entire string.
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
If that is the case, wont other columns will be having quotes?ray.wurlod wrote:You can set the quote character in the Format properties of a Sequential File stage. (Technically it's in the link properties.) ...
As i said earlier i wanna have the quotes for particular columns as i need not all the columns. So pls. suggest. Or kindly let me know that the solution i've mentioned in my question will be right or any other way of doing that?
Thanks for your time ray
Your time will be highly appreciated.
Thanks in advance
Veera
How come it will be correct?Could you pls. elaborate with an example so that i can easily understand because of youchulett wrote:What you require should be handled automatically by the stage as long as the data types are defined correctly for each field. ...
Your time will be highly appreciated
Thanks in advance,
Veera
Thanks in advance...
veera...
veera...
Hi Chulett,chulett wrote:When writing, 'string' columns are automatically quoted while 'numeric' fields are not. Why not simply try it and see if it works the way you need? ...
Thanks a lot for your advice. I've tried it and i got the output as you've mentioned earlier and also as i wanted. Thanks again for your time.
Thanks in advance,
Veera
Hi chulett,chulett wrote:When writing, 'string' columns are automatically quoted while 'numeric' fields are not. Why not simply try it and see if it works the way you need? ...
I dont want the quotes for string and as well as timestamp column. how do i can achieve this?because by default the column will have double quotes as it is non-numeric field.Am i right?
Kindly suggest me.
Thanks in advance,
veera.
Hi chulett,chulett wrote:When writing, 'string' columns are automatically quoted while 'numeric' fields are not. Why not simply try it and see if it works the way you need? ...
I dont want the quotes for string and as well as timestamp column. how do i can achieve this?because by default the column will have double quotes as it is non-numeric field.Am i right?
Kindly suggest me.
Thanks in advance,
veera.
I have no idea what you want or don't want here.veera24 wrote:I dont want the quotes for string and as well as timestamp column.
What is being quoted right now that you don't want quoted and why do they bother you? All fields can be quoted without issue or causing anyone any problems, hence the question.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 597
- Joined: Fri Apr 29, 2005 6:19 am
- Location: Singapore
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use 000 for the quote character on the Format, and use SQuote() function for each field that needs to be quoted. This allows individual fields to be quoted without all string fields to be quoted.
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.