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
Previous

User-declared Functions
HomeNext

Consistent SQL Generation

Copyright © 1993 - 2008. Progress Software Corporation. All rights reserved. | N. America: 800 876 3101 | World: +44 (0) 1753 218 930