This page last changed on Jan 09, 2008 by tkatz.
eDocs Home > BEA AquaLogic Data Services Platform 3.0 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
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)
This expression represents a dateTime value coming from the return type.
- Open the Design Palette
Window > Show View > Design Palette
- 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
How To
Other Resources
Contact BEA | Feedback | Privacy | (c) 2008 BEA Systems
|