I created the following statement in an edit window.
SELECT LENGTH('123456789 ')
from SYSIBM.SYSDUMMY1;
When I execute it, it returns 13 (and so it should)
However,
If I change the statement and add a parameter, like so;
SELECT LENGTH(:NUMVAR)
from SYSIBM.SYSDUMMY1;
and I execute it (when the parm window pops up, I enter the same value as the original statement, defined as VARCHAR or CHAR) and I get the following error;
Lookup Error - DB2 Database Error: ERROR [42610] [IBM][DB2] SQL0418N A statement contains a use of an untyped parameter marker, the DEFAULT keyword, or a null value that is not valid.
WORKAROUND:
In this example use the following statement:
select LENGTH (CAST(:numvar AS VARCHAR(55))) from SYSIBM.SYSDUMMY1;
STATUS:
Waiting for fix in a future version of Toad for DB2
© 2025 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center