Posted: Fri Feb 27, 2004 10:08 pm Post subject: If not FIELDTYPE, then what?
Voyager
Joined: 05 May 2003 Posts: 98
If I cannot use FIELDTYPE to determine the TYPE of a field itself (rather than the type of the data) what can I use?
I want to know if a given field is a BLOB or a char or a numeric. Is there a way?
No there is not a way to determine the DATATYPE of a variable or field.
If you are not sure what the ytype of the value is you should CAST it to the type you need. However bear in mind that not all possible CASTS are supported...
Remeber if you are using Generic XML then every field will be CHARacter, if you are modeling your message in the MRM then the type will be what ever you modelled it to be (so a CAST may not be needed)
You don't say what you are doing, but you will get better performance if you can avoid unnecessary CASTing by designing your flows to process
messages in which you know the expected types of the data in the message at design time. This means using seperate flows based on message type rather than CASTing or using lots of FILTER nodes to determine the type at runtime.
Cheers, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Thanks for that mgk. I had reached the same conclusion.
I have a procedure that builds a correlid from Environment provided data. The procedure expects a CHAR string, pads it to 24 bytes then casts the whole thing to a BLOB which it returns.
My problem was that sometimes the user provides a BLOB rather than a CHAR string (not unreasable in the circumstances). As you suggest I can get around this problem by casting whatever they give to a CHAR before calling the procedure.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum