Thanks Guys for the help. But nothing above worked for me.
I tried executing my first query without ). Iam getting the same error.
Iam using db2 8 so XMLCAst will not work ..I tried executing the above query but i was getting the below error.
B21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned

QL0104N An unexpected token "(" was found following "". Expected tokens may include: "ON AFTER <INTEGER>". SQLSTATE=42601
SQL0104N An unexpected token "(" was found following "". Expected tokens may include: "ON AFTER <INTEGER>