0

So I'm working with DB2 from command line. Before you ask, yes, it is running with admin rights and I can connect to the database and db2 is running.

Here is my input in the cmd:

db2 xquery declare default element namespace "http://tpox-benchmark.com/security"; for $s in db2-fn:xmlcolumn("SECURITY.SDOC")/Security where $s/Symbol= "BCIIPRC" return $s

And this is the error that I get:

SQL16002N An XQuery expression has unexpected token "/" following "pace http:". Expected tokens may include: ":". Error QName=err:XPST0003. SQLSTATE=10505

2 Answers2

0

And your question is?

Your shell may be stripping away those double quotes. Try enclosing the entire xquery statement in single quotes:

db2 'xquery declare ... return $s'
mustaccio
  • 18,234
  • 16
  • 48
  • 57
0

I replaced the " with ' and it works now. Thanks @mustaccio for the suggestion.

db2 xquery declare default element namespace "http://tpox-benchmark.com/security"; for $s in db2-fn:xmlcolumn("SECURITY.SDOC")/Security where $s/Symbol= "BCIIPRC" return $s