dbeaver / dbeaver/dbeaver

Execute Script not executing entire script for DB2 database

Open
#34,638 1 comment 0 reactions 0 assignees View on GitHub
x:db2 xf:sql execution
Dominant language
Java
Stars
51.8k
Forks
4.4k
Avg merge
3d 8h
Merged PRs (30d)
188

Description

### Description

I have a DB2 connection using the Db2 for IBM i driver. I have a CREATE OR REPLACE PROCEDURE statement that declares a cursor with variables in the WHERE clause, then does some checking of the values of my parameters in an IF ... END IF; block. Then finally it opens the cursor. When I Execute Script in DBeaver, it only executes until the first END IF; block, not all the way through to the last END of the procedure.

I attached a test procedure with three lines commented out. If you run it as is, with those lines commented out, it will run successfully. If you un-comment out those lines and run it, it will stop at the END IF; line and not evaluate the entire script.
[DBeaver Test Procedure.txt](https://github.com/user-attachments/files/16085640/DBeaver.Test.Procedure.txt)

I am on the Early Access version of DBeaver now, this was also happening on the 24.1.1 version, so I upgraded to the EA version to see if it had already been addressed.

### DBeaver Version

Community Version 24.1.2.202407021457

### Operating System

Windows 11

### Database and driver

db2_iseries
IBM Db2 driver for IBM i (replacement for iSeries and AS/400)

### Steps to reproduce

1. Run the attached procedure as is, with the three lines commented out, using the Execute Script (ALT + X), procedure will create successfully.
2. Un-comment out the three lines of the IF .... END IF block, and run again using Execute Script (ALT + X). The procedure will not create successfully and you'll notice DBeaver shows that it stopped evaluating on the END IF line and seemingly did not evaluate the entire procedure through to the final END.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.