ibmdb / vscode-extension

vscode extenstion for db2 as db2connect
7 stars 2 forks source link

Unable to run SP with NULL parameter #67

Closed dangeville-n closed 10 months ago

dangeville-n commented 10 months ago

I'm trying to drop a schema and all of the tables using this command:

CALL SYSPROC.ADMIN_DROP_SCHEMA('EZSCH', NULL, ERRORSCHEMA, ERRORTABLE);

it does not delete anything And when I run the file it says

CALL SYSPROC.ADMIN_DROP_SCHEMA ( ?, ?, ?, ? )

Number of Rows returned: 1

it's with Db2 in IBM cloud. When I do the same thing in the SQL console it works.

Is there a different syntax to call this stored procedure ?

dangeville-n commented 10 months ago

I tried to run it explicitly through a right click. But it does not let me enter NULL as a value.

bimalkjha commented 10 months ago

@dangeville-n Use null instead of NULL. Thanks.

dangeville-n commented 10 months ago

@bimalkjha it did not work. Error: [IBM][CLI Driver][DB2/LINUXX8664] SQL0443N Routine "ADMIN_DROP_SCHEMA" (specific name "*P_SCHEMA") has returned an error SQLSTATE with diagnostic text "Invalid value specified for MODE parameter". SQLSTATE=38000

bimalkjha commented 10 months ago

@dangeville-n I am able to reproduce the issue and will deliver fix soon. Issue is not with SP execution but issue is specific to the NULL parameter. For non-null parameters, stored procedures are running fine. Thanks.

bimalkjha commented 10 months ago

Pushed below change in file src/controllers/mainController.js to fix this issue: image

This fix will be available as part of next release of db2connect extension. Thanks.