Calling Database Functions

DataDirect XQuery® lets you call any function defined in your database directly as an XQuery external function. Both built-in database functions and user-defined SQL functions are supported. External Java functions can also be called, and these can invoke database functions. Our support for external functions provides a way to invoke SQL functions or Java functions with virtually no performance overhead. Because this support is a central part of our open design, you can use DataDirect XQuery® in just about any architecture.

Example 16. Calling Database Functions

XQuery

declare function ddtek-sql:RTRIM($s as xs:string) as xs:string external;
collection('USERS')/USERS/ddtek-sql:RTRIM(LASTNAME)

Generated SQL

SELECT ALL
RTRIM(nrm7."LASTNAME") AS RACOL1
FROM
"PEPPINO"."USERS" nrm7

Try DataDirect XQuery® Free!

Put the power, scalability, and performance of DataDirect XQuery® to work for you today! Our free trial lets you see for yourself how easy it is to build data integration applications that access relational, EDI, and other file formats as XML!

Download DataDirect XQuery® today!

Online Video Tutorials!

Our easy-to-follow online video tutorials are a great way to get acquainted with the many features of DataDirect XQuery®.

And if you like what you see, download a free copy today and try DataDirect XQuery® for yourself!