IBM Support

SQL Editor shows syntax errors when the DDL statement terminator is set to semi-colon

Troubleshooting


Problem

When opening an existing valid DB2 for z/OS SQL script in IBM Data Studio V3.1, the editor might show spurious syntax errors if the script contains a routine definition, including stored procedures, functions, or trigger definitions. The errors occur when the statement terminator for the script is set to semi-colon (;), and the body of the routine definition also contains statements separated by semi-colons.

Symptom

You receive syntax errors for a routine definition that contains valid SQL. For example, you receive syntax errors for scripts that you created in a previous release of Data Studio when you open them in Data Studio V3.1.

Cause

In versions prior to Data Studio V3.1, the SQL editor used the SQL syntax parsers in DB2 for z/OS data servers which allowed the script statement terminator to be set to semi-colon for routine definitions.

In Data Studio v3.1, the SQL syntax parser has been changed and now requires that a character other than semi-colon is used as the statement terminator. Restricting the use of the semi-colon now aligns with the behavior of the SQL syntax parsers in DB2 for Linux, UNIX, and Windows data servers as well as the statement processing rules in DB2 for z/OS data servers.

Resolving The Problem

If the script contains a routine definition, then the statement terminator for the script must be set to something other than semi-colon. The semi-colon is reserved for use as the statement separator within the routine body.

Use the Set Statement Terminator action in the SQL editor to set the statement terminator for scripts to a character other than semi-colon. The backslash (\) character is the recommended statement terminator.

[{"Product":{"code":"SS62YD","label":"IBM Data Studio"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"SQL and XQuery Development","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"3.1","Edition":"IBM Data Studio","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21568227