Definition:
In Oracle PL/SQL, SYS_DBURIGEN is a built in function which is used to generate a URL for a row object in a table. It accepts column name, an attribute name, and an optional rowid to generate the URL of DBURIType. The URL can then be used to retrieve an XML document from the database. This URL is similar to XML path which is used to retrieve a row from an XML document in the database. Note that the input column or attribute name must belong to the same table. If you want the URL to point only to the text of the document, then specify the optional 'text()' parameter.
Example Syntax:
SYS_DBURIGEN ([column | attribute | rowid],, ' text ( ) ')
In the syntax, 'text()' is used if URL has to point to the text in the XML document.
Example Usage:
The SQL example below generates the URL for ENAME column of EMP table:
SQL> SELECT SYS_DBURIGEN(ENAME, JOB)
FROM EMP
WHERE EMPNO=100;
SYS_DBURIGEN(ENAME,JOB)(URL, SPARE)
--------------------------------------------------------------------------------
DBURITYPE('/PUBLIC/EMPLOYEE/ROW[ENAME=''JOHN'']/JOB', NULL)
The SQL example below generates the URL for ENAME column of EMP table and pointing to the 'text()' contained by JOB column:
SQL> SELECT SYS_DBURIGEN(ENAME, JOB,'TEXT()')
FROM EMP
WHERE EMPNO=100
SYS_DBURIGEN(ENAME,JOB,'TEXT()')(URL, SPARE)
--------------------------------------------------------------------------------
DBURITYPE('/PUBLIC/EMPLOYEE/ROW[ENAME=''JOHN'']/JOB/text()', NULL)
Related Links: