简体   繁体   中英

Query delimiter in DB2 SQL

I'm running DB2 SQL from Eclipse (ie not from command line). I know I can configure Eclipse with a different delimiter (eg # ) 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM