Marcos
Marcos

Reputation: 450

Query delimiter in DB2 SQL

I'm running DB2 SQL from Eclipse (i.e. not from command line). I know I can configure Eclipse with a different delimiter (e.g. #) so that functions and atomic blocks work just fine when using ;.

But, is there any other way to do this? Can I change the delimiter only within part of my file? For example, MySQL's DELIMITER #.

I'm using Eclipse SDK version Luna SR2 (4.4.2) and SQL Explorer 3.6

Upvotes: 0

Views: 3249

Answers (1)

mustaccio
mustaccio

Reputation: 18945

You don't say which Eclipse tool you use. In the SQL Editor of IBM Data Studio (which is built on Eclipse) you can use the following construct to modify the statement terminator at any point in the script:

--<ScriptOptions statementTerminator="@"/>

When running scripts using DB2 command line processor you can use

--#SET TERMINATOR @

Note the latter is case-sensitive.

Both are formatted as SQL comments, as you can see, so they don't affect tools that do not recognize these constructs -- they will be simply ignored.

Upvotes: 1

Related Questions