Hi All,
I'm trying to read a xml message into a varchar field. The length of the xml message could vary and I'm reading it into a single nvarchar field. As of now I have not defined any length for the nvarchar field as the length of the message could vary.
I have 2 approaches in mind:
1. Define a very high length so that the message does not cross that length
2. Dont define length for the nvarchar field and leave it as it is.
Please let me know which of the above 2 approaches would work well with DataStage v8.5
Thanks.
Varchar field length
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 11
- Joined: Tue Oct 29, 2013 7:25 pm
- Location: USA
-
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
In option 2 is better, dont define anything in length(unbounded), datastage will take the appropiate length and meomory.In case you use option1 and your message cross the length defined, datastage will discard the strings which are more then specified maximum length and process incomplete xml.
Thanks
Prasoon
ETL Consultant
LinkedIn :- http://www.linkedin.com/profile/view?id ... ab_pro_top
Blog:- http://dsshar.blogspot.com/
Prasoon
ETL Consultant
LinkedIn :- http://www.linkedin.com/profile/view?id ... ab_pro_top
Blog:- http://dsshar.blogspot.com/
Please note that as a rule it isn't a good idea to use unbounded strings except in cases where the length is truly unknown. DataStage will allocate a significant amount of space for any unbounded column.
In other words - don't be lazy and do this for all VARCHAR's - your jobs will take up a lot more memory (and probably run slower!).
In other words - don't be lazy and do this for all VARCHAR's - your jobs will take up a lot more memory (and probably run slower!).
Last edited by asorrell on Tue Dec 17, 2013 6:13 pm, edited 1 time in total.
-
- Premium Member
- Posts: 11
- Joined: Tue Oct 29, 2013 7:25 pm
- Location: USA
Hi All,
Thanks for your replies. As I mentioned I prefer defining the length of the varchar field but since its a response from some other system I dont have control over that and further they too told it is dynamic and change.
When we dont define the length for a varchar field what is the length that is assigned by DataStage?
Thanks for your replies. As I mentioned I prefer defining the length of the varchar field but since its a response from some other system I dont have control over that and further they too told it is dynamic and change.
When we dont define the length for a varchar field what is the length that is assigned by DataStage?
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: