I don't know if it's just me, but DB2 seems to have the worst syntatic
parser ever created!
Even after triple checking the documentation online, for the syntax of
the statements the CLP seems to be unable to parse the simplest of
statemets!
For example, I would very much like to have this piece of work to
work:
IF EXISTS ( Select 'DELETE'
from sysibm.routines
where specific_schema = 'NHM'
and ROUTINE_TYPE = 'FUNCTION'
and ROUTINE_NAME = 'TESTCONSTRUCTS ')
THEN DROP FUNCTION TESTCONSTRUCTS
END IF@
The parser messages are ambiguous as always:
Erros msg: An unexpected token "IF EXISTS ( Select 'DELETE'" was
found following "BEGIN-OF-STATEMENT". Expected tokens may include:
"<space>
This wonderful parser is so user friendly, it also seem to be able to
parse better the previous code, if it's surrounded by a BEGIN
Atomic ... END@ statement;
in this last case, the parser only fails when it's faced with the END
IF statement.
I am farily used to both PL/SQL and TSQL and can say without a doubt,
that i've never seen any parser this bad! Not only does CLP force a
person to introduce ending statement characters, not even there own
offical SQL PL syntax is parsable.
Any help?
parser ever created!
Even after triple checking the documentation online, for the syntax of
the statements the CLP seems to be unable to parse the simplest of
statemets!
For example, I would very much like to have this piece of work to
work:
IF EXISTS ( Select 'DELETE'
from sysibm.routines
where specific_schema = 'NHM'
and ROUTINE_TYPE = 'FUNCTION'
and ROUTINE_NAME = 'TESTCONSTRUCTS ')
THEN DROP FUNCTION TESTCONSTRUCTS
END IF@
The parser messages are ambiguous as always:
Erros msg: An unexpected token "IF EXISTS ( Select 'DELETE'" was
found following "BEGIN-OF-STATEMENT". Expected tokens may include:
"<space>
This wonderful parser is so user friendly, it also seem to be able to
parse better the previous code, if it's surrounded by a BEGIN
Atomic ... END@ statement;
in this last case, the parser only fails when it's faced with the END
IF statement.
I am farily used to both PL/SQL and TSQL and can say without a doubt,
that i've never seen any parser this bad! Not only does CLP force a
person to introduce ending statement characters, not even there own
offical SQL PL syntax is parsable.
Any help?
Comment