23 Jun
2011
23 Jun
'11
4:55 p.m.
Hi, I want to rebind the variables, but got the result that wasn't expected. How can I get the expected result without creating new processor instance? (When I use proc.query() and don't declare $var2 then got the expected result. But I have to declare $var2.) ---------- String query = "declare variable $var1 as xs:string external; " + "declare variable $var2 as xs:string := 'BBB'; " + "($var1, $var2)"; QueryProcessor proc = new QueryProcessor(query, new Context()); // "AAA BBB" proc.bind("var1", "AAA"); System.out.println(proc.execute()); //duplicate definition error of $var2 //proc.query(query); // "AAA BBB" not "CCC BBB" proc.bind("var1", "CCC"); System.out.println(proc.execute()); proc.close(); ---------- Thanks, Oda.