XmlQueryContext::setVariableValue

API Ref

#include <DbXml.hpp>

void XmlQueryContext::setVariableValue( const std::string &name, const XmlValue &value);

bool XmlQueryContext::getVariableValue( const std::string &name, XmlValue &value);

void XmlQueryContext::setVariableValue( const std::string &name, const XmlResults &value);

bool XmlQueryContext::getVariableValue( const std::string &name, XmlResults &value);


Description: XmlQueryContext::setVariableValue

Creates an externally-declared XQuery variable by binding the specified value, or sequence of values, to the specified variable name.

The XmlQueryContext::setVariableValue method may be called at any time during the life of the application.

Parameters

name
The name of the variable to bind. Within the XQuery query, the variable can be referenced using the normal $name syntax.
value
The value to bind to the named variable. If value is an XmlResults object, a sequence of values is bound to the variable.

Description: XmlQueryContext::getVariableValue

Returns the value that is bound to the specified variable. If there is no value binding then the function returns false and value is set to a null value (XmlValue::isNull() or XmlResults::isNull() returns true).

Parameters

name
The name of the variable whose value is required.
value
The value bound to the variable.

Errors

The XmlQueryContext::getVariableValue method may fail and throw XmlException, encapsulating one of the following non-zero errors:

INVALID_VALUE
It is not valid to use the XmlValue get method for variables with more than one value

APIRef

Copyright (c) 1996,2007 Oracle. All rights reserved.