2. Cast Using a Built-In XQuery Function This page last changed on Feb 26, 2008. .stickable, h1, h2, h3, h4, h5 false true Show Sticky notes Hide Sticky notes Save Cancel Oracle Data Service Integrator Documentation > Data Services Developer's Guide # How To Cast Using a Built-In XQuery Function This topic describes how to use a built-in XQuery function to cast values of different data types in an update map. Example See Also ## Example You can cast an element from one data type to another using a built-in XQuery cast function when: Type promotion does not occur. The data comes from a variable or an other source that is not a constant A built-in function that performs the cast you want is available in the Design Palette. To cast using a built-in XQuery function: Click the Update Map tab. Click the disabled element in an update block on the left. In the expression editor, you see an expression that uses fn-bea:value() to map from the return type on the right, for example:
       fn-bea:value($CUSTOMER/CUSTOMER_SINCE)
3. This expression represents a dateTime value coming from the return type. Open the Design Palette
       Window > Show View > Design Palette
6. Expand XQuery Functions, then a category (for example, Duration, Date, and Time Functions). Drag the function you want to the expression editor (for example, fn-bea:date-from-dateTime), leaving the existing expression there. If feasible, use the existing expression as an argument to the function, for example:
       fn-bea:date-from-dateTime( fn-bea:value($CUSTOMER/CUSTOMER_SINCE) )
Here the original value is used as the $dateTime argument to fn-bea:date-from-dateTime(). Test the update map cast to make sure it works as you expect. ## See Also ##### Concepts Understand Mappings with Different Data Types ##### How To Cast Using a Custom XQuery Function Test an Update Map Cast ##### Other Resources XQuery Tutorial at W3Schools

Document generated by Confluence on Jan 13, 2009 15:57