What about calling query.next() first before accessing the value? By the way, your "1" is ignored if you set the type of binding to "Out".