Advertisements
RSS

OSB Xquery function if-absent example

17 Mar

Since I’m on a roll with Xquery functions let’s add an addition. Especially since the earlier example is a bit large for people looking for a simple example.

So maybe this helps better to get an understanding. After working with Tibco BusinessWorks for some years I used a lot off the internal tib:functions supplied out-of-the-box and always found it a disappointment that Oracle (read BEA here) didn’t offer such a nice catalog to help you out. So over time I added a lot off these functions to my own library.

For example the function if-absent helps me to prevent all these “is-value1-there-then-use-it-and-if-not-i-want-you-to-use-value2” checks.

declare function funcRBX:if-absent($arg as item()* , $value as item()* ) as item()*
{
  if (exists($arg)) then $arg else $value
};

Works like a charm … ;-)

Advertisements
 
Leave a comment

Posted by on 17-03-2011 in Oracle, OSB, XQuery

 

Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: