vscode-db2i icon indicating copy to clipboard operation
vscode-db2i copied to clipboard

Run Cell in INB document does not run with same code as CTRL+R

Open m-tyler opened this issue 1 year ago • 0 comments

Run Cell in INB document does not run with same code as CTRL+R

If you write SQL in a INB document and run it using CTRL+R the newer DB2 for IBM i JDBC service is used.

  1. However, if you use the Execute Cell button (see image below) an attempt is made but it does not run the same and uses the older method that uses the QSHELL DB2 tool (call QSYS/QZDFMDB2 PARM('-d' '-i' '-t')).

  2. Also, if a cell happens to have a leading semi colon nothing happens. You will be returned a SQL statement empty or blank error even though the process sees all the SQL statements and passes them to call QSYS/QZDFMDB2 PARM('-d' '-i' '-t').

  3. Statement prefixes are not allowed with the Execute Cell feature.

Steps to recreate above issues:

  1. open or create a new document of type .INB
  2. insert code of type SQL
  3. insert more than one statement 3.a add more than one statement without table qualifications. 3.b precede the first statement to run with a semi colon 3.c prefix any SQL statement with CSV: or JSON:
  4. results will be different depending on the test in 3.a-b 4.a image 4.b image 4.c image

Note: using CTRL+R you can only run one statement at a time and only one under the cursor.

A low pty issue for me

Thanks, Matt

m-tyler avatar Feb 22 '24 20:02 m-tyler