Hello,
I'm trying to create a stored procedure that calls a StoredProcedure-view.
Question 1:
They can explain to me how I can call StoredProcedure-view using variables?
EXAMPLE:
--this works EXEC 'INSERT INTO #TMP_GSP__MNOITT SELECT * FROM GSP_PROC_MNOITT_VIEW WITH PARAMETERS( ''placeholder'' = (''$$itemcode$$'',''' || :itemcode || '''), ''PLACEHOLDER'' = (''$$_level$$'',''0''), ''PLACEHOLDER'' = (''$$parent$$'',''-1''), ''PLACEHOLDER'' = (''$$parentqty$$'',''0''))';
--this NOT works
INSERT INTO #TMP_GSP_RECURS_MNOITT SELECT * FROM GSP_PROC_MNOITT_VIEW WITH PARAMETERS( PLACEHOLDER."$$itemcode$$" => :itemcode , PLACEHOLDER."$$parent$$" => :parent, PLACEHOLDER."$$parentqty$$" => :parentqty);
Question 2:
I can pass a NULL value to a nvarchar parameter?
In this example the parameter 'level' is integer and NULL received correctly, however the parameter 'parent' is nvarchar (5000) and receives an alphanumeric value 'null'.
SELECT * FROM GSP_PROC_MNOITT_VIEW WITH PARAMETERS(
'PLACEHOLDER' = ('$$itemcode$$', '02005300186401002116'),
'PLACEHOLDER' = ('$$_level$$', 'null'),
'PLACEHOLDER' = ('$$parent$$','null'),
'PLACEHOLDER' = ('$$parentqty$$','1'));
--this NOT works
SELECT * FROM GSP_PROC_MNOITT_VIEW WITH PARAMETERS(
'PLACEHOLDER' = ('$$itemcode$$', '02005300186401002116'),
'PLACEHOLDER' = ('$$_level$$', 'null'),
'PLACEHOLDER' = ('$$parent$$',null),
'PLACEHOLDER' = ('$$parentqty$$','1'));
I'm working with HANA PLATFORM Rev. 53.
Thank you very much.