Hi,
A question almost identical to this was recently answered on the
developerworks Viper Forum.
http://www-128.ibm.com/developerwork...=118807&cat=19
Basically, a prolog itself is not enough, you need to follow it with
some xquery. The simplest query I used was the expression 3. So I
tried:
db2 -td%
xquery declare default element namespace "http://posample.org"; 3%
and this worked.
Note that since the ; is used to separate the prolog from the xquery
body, I changed the terminator to %.
I hope this helps, post if you still have trouble.
TomE
tammo.mueller@gmail.com wrote:
> Hi,
>
>
> I'm trying to execute a xquery statement and I get always errors.
> It seems that only the prolog section is giving me errors.
> If I want to declare a namespace the xquery processor is coming up with
> an "unexpected token" error.
> The same error appears if I just set the version.
> The xquery statement itself is working without prolog, but I get no
> results because of the missing namespace.
>
>
> db2 => xquery declare default element namespace "http://posample.org";
>
> SQL16002N An XQuery expression has an unexpected token "" following
> "http://posample.org"". Expected tokens may include: "<MainModule>".
> Error
> QName=err:XPST0003. SQLSTATE=10505