Bind | R Documentation |
Binds a value to a variable.
Bind(query_obj, ...)
query_obj |
QueryClass instance-ID |
... |
Binding Information |
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.
Boolean value which indicates if the operation was executed successfull
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.