Commit f5fd2dd
committed
Added support for SET TERMINATOR instruction
This allows to temporarily change the statement separator with an inline comment and thus supports to execute statements that uses the semicolon within their expression, for example triggers or procedures with `BEGIN..END` blocks.
Example:
```sql
DROP PROCEDURE foobar;
--#SET TERMINATOR !
CREATE PROCEDURE foobar
BEGIN
declare v char(10);
select value into v from sometable;
if v = 'test' then
update sometable set value = '';
end if;
END!
--#SET TERMINATOR ;
LABEL ON PROCEDURE foobar IS 'Example';
```
This commit fixes feature request 433 on sourceforge (https://sourceforge.net/p/squirrel-sql/feature-requests/433/).
It currently only supports the default QueryTokenizer. The statement separator is only changed for the current execution.1 parent 384023f commit f5fd2dd
File tree
1 file changed
+16
-0
lines changed- sql12/core/src/net/sourceforge/squirrel_sql/fw/sql/querytokenizer
1 file changed
+16
-0
lines changedLines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
167 | 183 | | |
168 | 184 | | |
169 | 185 | | |
| |||
0 commit comments