Using Toad for DB2 v 4.5.1.917, on Query Builder:
1. Create a new calculated field
2. Use builder to write a sub string function
3. Toad writes it as:
SUBSTR(ISYCODE.PICK_UP_DATA_FLD FROM 1 FOR 2)
4. Running this query generates an error:
DB2 Database Error: ERROR [42601] [IBM][DB2] SQL0199N The use of the reserved word "FROM" following "" is not valid. Expected tokens may include: "( . MICROSECONDS MICROSECOND SECONDS SECOND MINUTES MINUTE". SQLSTATE=42601
STATUS
Waiting for a fix with ST67472 on a future release of Toad for DB2.
WORKAROUND:
Manually change the query on the query tab: replace FROM and FOR to commas
Example:
from
SUBSTR(ISYCODE.PICK_UP_DATA_FLD FROM 1 FOR 2)
to:
SUBSTR(ISYCODE.PICK_UP_DATA_FLD , 1 , 2)
Re-run the query and it will work
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center