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 ;
Request clarification before answering.
Hi Santosh,
overloading of procedures is not possible. You have to create a procedure with a different name for each parameter set.
For some usecases, an optional IN Parameters with a DEFAULT value could be a solution.
Regards,
Jörg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.