cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

I want to create 2 stored procedures with different sets of params. is it possible in HANA SQL.

Example:

Create Table DEMO_TABLE ( ID INTEGER, NAME VARCHAR(10), NAME2 VARCHAR(10) );
CREATE PROCEDURE pkg_demo_entry(IN ID             INTEGER, IN NAME 		    NVARCHAR(10), IN NAME2        NVARCHAR(10) ) LANGUAGE SQLSCRIPT AS BEGIN INSERT INTO DEMO_TABLE (ID, NAME, NAME2) VALUES(:ID, :NAME, :NAME2); END ;
CREATE PROCEDURE pkg_demo_entry(IN ID             INTEGER, IN NAME 		    NVARCHAR(10) ) LANGUAGE SQLSCRIPT AS BEGIN INSERT INTO DEMO_TABLE (ID, NAME, NAME2) VALUES(:ID, :NAME, 'XXXXX'); END ;
0 Likes
View Entire Topic
lbreddemann
Active Contributor

An alternative option is to take the approach used by the PAL procedures:

use a generic “parameters” table structure to communicate parameters to the procedure.

This makes calling the procedure more complex as one first has to establish the table structure (often a temporary table), fill it with the required parameters, and then call the procedure with the reference to the table. On the other hand, this call sequence will be identical for any call to the procedure.

The different functional variations of the procedure can then either be handled in different branches of the “main” procedure or via sub-procedured.

Anyhow, you probably get the idea.