IBM / db2forzosdeveloperextension-about

IBM Db2 for z/OS Developer Extension for VS Code
https://IBM.github.io/db2forzosdeveloperextension-about/
Other
12 stars 8 forks source link

Execute stored procedures from catalog and receive OUT values #152

Open b-tsao opened 3 months ago

b-tsao commented 3 months ago

Description of the feature or enhancement

Data studio had the feature to execute stored procedures from catalog and read OUTPUT parameter values. In developer extension currently attempting to execute a stored procedure via CALL ... allows inputing host variable data types and values but they're all considered INPUT variables even though the stored procedure being invoked contains OUTPUT variables.

b-tsao commented 3 months ago

For those coming across with the same issue, there is a potential workaround.

Here's a working example of a C built-in stored procedure

  1. Create a spsql file and put in the CREATE PROCEDURE <sp_name>(<parameters>) The sp_name is the desired stored procedure to be invoked and the parameters would be the IN/OUT parameters of the stored procedure image
  2. In the upper right corner (or right-click for context menu) select "Run Stored Procedure" image image
  3. After executing the stored procedure you should be able to see the results image image

The CREATE PROCEDURE <sp_name>(<parameters>) can be kept to a minimum (there is no need for the rest of the DDL). Adding LANGUAGE could prevent the execution of the stored procedure due to a check, simply omit it. image