Bind {RBaseX} | R Documentation |
Bind
Description
Binds a value to a variable.
Usage
Bind(query_obj, ...)
Arguments
query_obj |
QueryClass instance-ID |
... |
Binding Information |
Details
Binding information can be provided in the following ways:
name, value Name and value for a variable.
name, value, type Name, value and type for a variable.
name, list(value) Name, list of values.
name, list(value), list(type) Name, list of values, list of types.
For a list of possibe types see https://docs.basex.org/wiki/Java_Bindings#Data_Types
This method returns self invisibly, thus making it possible to chain together multiple method calls.
Value
Boolean value which indicates if the operation was executed successfull
Examples
## Not run:
query_obj <- Query(Session,
"declare variable $name external; for $i in 1 to 2 return element { $name } { $i }")
Bind(query_obj, "$name", "number")
print(Execute(query_obj))
query_obj <- Query(Session,
"declare variable $name external; for $i in 3 to 4 return element { $name } { $i }")
Bind(query_obj, "$name", "number", "xs:string")
print(Execute(query_obj))
query_obj <- Query(Session,
"declare variable $name external;
for $t in collection('TestDB/Books')/book where $t/@author = $name
return $t/@title/string()")
Bind(query_obj, "$name", list("Walmsley", "Wickham"))
print(Execute(query_obj))
query_obj <- Query(Session,
"declare variable $name external;
for $t in collection('TestDB/Books')/book where $t/@author = $name
return $t/@title/string()")
Bind(query_obj, "$name", list("Walmsley", "Wickham"), list("xs:string", "xs:string"))
print(Execute(query_obj))
## End(Not run)
[Package RBaseX version 1.1.2 Index]