1.1

Table Of Contents
Must be a SQL character string type, such as CHAR, VARCHAR, LONG
VARCHAR, or CLOB. If you specify a type that is not a valid character string
type, SQLFire throws an error.
string-data-type
Examples
In the x_table table, to display the contents of the xcol XML column, use this statement:
SELECT ID,
XMLSERIALIZE(
xcol AS CLOB)
FROM x_table
To retrieve the results from JDBC, you can use the JDBC getCharacterStream() or getString() method.
To display the results of an XMLQUERY operation, use the following statement:
SELECT ID,
XMLSERIALIZE(
XMLQUERY('//student[@age>20]'
PASSING BY REF xcol EMPTY ON EMPTY)
AS VARCHAR(50))
FROM x_table
Usage note
SQLFire requires that a JAXP parser (such as Apache Xerces) and Apache Xalan are listed in the Java classpath
for the XML functions to work. If either the JAXP parser or Xalan is missing from the classpath, attempts to
use the XMLSERIALIZE operator will result in an error. In some situations, you may need to take steps to place
the parser and Xalan in your classpath. See XML on page 614 for details.
YEAR function
The YEAR function returns the year part of a value. The argument must be a date, timestamp, or a valid character
string representation of a date or timestamp. The result of the function is an integer between 1 and 9 999. If the
argument can be null, the result can be null; if the argument is null, the result is the null value.
Syntax
YEAR ( expression )
Example
Select all the projects in the PROJECT table that are scheduled to start (PRSTDATE) and
end (PRENDATE) in the same calendar year.
SELECT * FROM PROJECT WHERE YEAR(PRSTDATE) = YEAR(PRENDATE)
SQLFire Built-in Functions
A number of functions are unique to vFabric SQLFire.
DSID Function
Return the string form of the unique distributed member process identity in the SQLFire cluster.
Description
The DSID function returns the string form of the distributed member process identity uniquely represented in
the distributed system. By default, a SELECT query with the DSID function in the SelectExpression lters out
579
SQL Language Reference