if (FALSE) {
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))
}
Run the code above in your browser using DataLab