Posts

Showing posts from 2016

OSB 12c custom xquery functions

Here are the some of OSB custom xquery function that came across: 1.        mmddyyyy  to date  conversion: declare function ns1:mmddyyyy-to-date   ( $dateString as xs:string? )  as xs:date? {    if (empty($dateString))     then ()    else      xs:date(concat(substring($dateString,7,4),'-',             substring($dateString,1,2),'-',             substring($dateString,4,2)))  } ; 2.        day of week:  declare function ns1:day-of-week   ( $date as xs:date? )  as xs:integer? {   if (empty($date))   then ()   else xs:integer(($date - xs:date('1901-01-06'))           div xs:dayTimeDuration('P1D')) mod 7  } ; 3.        day of week name:  declare function ns1:day-of-week-name   ( $date as xs:date? )  as xs:string? {    ('Sunday', 'Monday', 'Tuesday', 'Wednesday',     'Thursday', 'Friday', 'Saturday')       [ns1:day-of-week($date) + 1]  } ;

XQuery functions that supported by OSB

NAMESPACES ------------------------------------------------------------------------ xml=http://www.w3.org/XML/1998/namespace fn=http://www.w3.org/2004/07/xpath-functions op=http://www.w3.org/2004/07/xpath-operators err=http://www.w3.org/2004/07/xqt-errors fn-bea=http://www.bea.com/xquery/xquery-functions op-bea=http://www.bea.com/xquery/xquery-operators dt-bea=http://www.bea.com/xquery/xquery-datatypes var-bea=http://www.bea.com/xquery/xquery-variables xf-aug02=http://www.w3.org/2002/08/xquery-function op-aug02=http://www.w3.org/2002/08/xquery-operators xs=http://www.w3.org/2001/XMLSchema xsd=http://www.w3.org/2001/XMLSchema xdt=http://www.w3.org/2004/07/xpath-datatypes local=http://www.w3.org/2004/07/xquery-local-functions declare default function namespace "http://www.w3.org/2004/07/xpath-functions XQUERY FUNCTIONS ------------------------------------------------------------------------ fn:node-name($arg as node()?) as xs:QName? fn: