problem in updating and using variables

Hi,

Im very new to Tamino.
Im Using Tamino XMLServer 4.2.1.
with the documentation that is provided for XQuery tool Im trying to learn XQuery.

My query is

update replace /party/enterpriseId[. = “10101”] with “00000004”

But Im getting an error as follows

The specified query could not be processed.Either the query is not valid or the connection to the database is no longer available.

Error parsing the XQL query;Unexpected token replace found,expected was End of query

even when I use a variable it is showing some error.

Query is :
let $var := party/enterpriseId
return

$var is the Id

and the error message is

The specified query could not be processed.Either the query is not valid or the connection to the database is no longer available.

Error parsing the XQL query;Unexpected token var found,expected was End of query

even the same kindof error appears when using FLWR

query :
for /party/enterpriseId
return
/party/enterpriseId

and the error message is

The specified query could not be processed.Either the query is not valid or the connection to the database is no longer available.

Error parsing the XQL query;Unexpected token return found,expected was End of query

===============================================

Can anybody please help me.

Im struck here and it is affecting my work a lot.

Thanks in advance,
Vijayanand

Hi,

first of all: you should be using the more recent Tamino version 4.4

Concerning your problems:
From the error message, I wonder how you submit the query to Tamino: it seems you are sending it as an X-Query, not as XQuery. You can use the XQuery tool or the Tamino Interactive Interface to send XQuery for testing.

Then, your queries are not valid XQuery expressions are they have unbound paths. I.e., related them to input() or collection(“…”):


let $var := input()/party/enterpriseId
return
<p> $var is the Id</p> 

This query will always return the fixed string
$var is the Id
which is probably not what you want. If you want the value of $var to be returned, the query would be
code]
let $var := input()/party/enterpriseId
return

{$var} is the Id

[/code]

Regards

Harald