Hello everyone,
I am having trouble with using a result view from within a procedure.
The definition of the result view looks like this:
create procedure NEO_CCG502K10CQSC8NX8DNT6J7MA.GET_RULE_050_PROC_V1(
in i_tenant_id NVARCHAR,
out o_result NEO_CCG502K10CQSC8NX8DNT6J7MA.RULE_050_TYPE)
reads sql data
with result view NEO_CCG502K10CQSC8NX8DNT6J7MA.RULE_050_PROC_VIEW
as ...
I can call this result view from the SQL console the following without any problems:
select * from NEO_CCG502K10CQSC8NX8DNT6J7MA.RULE_050_PROC_VIEW WITH PARAMETERS ('placeholder' = ('$$i_tenant_id$$', '''0001'''));
Next step is, I try to call this from within a (different) SQL-procedure. I declare the following:
...
declare cursor c_cursor for select * from NEO_CCG502K10CQSC8NX8DNT6J7MA.RULE_050_PROC_VIEW WITH PARAMETERS ('placeholder' = ('$$i_tenant_id$$', '''0001'''));
...
The procedure is compilable, and I can create it, but once I execute it, I get the following error:
Could not execute 'call NEO_CCG502K10CQSC8NX8DNT6J7MA.EVALUATE_RULES_050_PROC_V1( '0001', '0001', o_result =>? )' in 475 ms 994 µs .
SAP DBTech JDBC: [257]: sql syntax error: [257] "NEO_CCG502K10CQSC8NX8DNT6J7MA"."EVALUATE_RULES_050_PROC_V1": line 23 col 2 (at pos 873): [257] (range 3) sql syntax error exception: sql syntax error: incorrect syntax near "0001": line 1 col 126 (at pos 126)
I then tried to play around with the Input Variable, for instance this
select * from NEO_CCG502K10CQSC8NX8DNT6J7MA.RULE_050_PROC_VIEW WITH PARAMETERS ('placeholder' = ('$$i_tenant_id$$', '0001'));
works as well, once I call it directly from the SQL console, but once I use exactly this SQL syntax in my procedure,
then it gives me the following error:
Could not execute 'call NEO_CCG502K10CQSC8NX8DNT6J7MA.EVALUATE_RULES_050_PROC_V1( '0001', '0001', o_result =>? )' in 304 ms 184 µs .
SAP DBTech JDBC: [1301]: numeric or value error: [1301] "NEO_CCG502K10CQSC8NX8DNT6J7MA"."EVALUATE_RULES_050_PROC_V1": line 25 col 3 (at pos 946): [1301] (range 3) numeric or value error exception
Once to try to call the result view from my SQL console like this:
select * from NEO_CCG502K10CQSC8NX8DNT6J7MA.RULE_050_PROC_VIEW WITH PARAMETERS ('placeholder' = ('$$i_tenant_id$$', '"0001"'));
then I get the following error:
Could not execute 'select * from NEO_CCG502K10CQSC8NX8DNT6J7MA.RULE_050_PROC_VIEW WITH PARAMETERS ('placeholder' = ...' in 282 ms 621 µs .
SAP DBTech JDBC: [2048]: column store error: search table error: [34023] Internal error during instantiating calculation model
What am I missing? Can anyone give me some advice?