Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: How to call HANA store procedure with input table variable in a SQL console?

$
0
0

Slightly missed the point.

The question was about providing an INPUT variable.

 

An in fact it is not possible to call a procedure with an table type input variable from the SQL console.

You have to build a wrapper to call such a procedure:

 

create type myusers as table (user_name nvarchar(60));
create procedure count_users (IN user_tab myusers, OUT user_count bigint )
language sqlscript
as
begin    select count(*) into user_count from :user_tab;
end;
call count_users (? , ?)
Could not execute 'call count_users (? , ?)' . 
SAP DBTech JDBC: [7]: feature not supported: 
Parameterized input table parameter is not allowed: line 1 col 19 (at pos 18)

 

 

A wrapper for this could look like this:

create procedure call_cu (out user_count bigint)
language sqlscript
as
begin    v_users = select user_name from users;    call count_users (:v_users, :user_count);
end;
call call_cu (?)

--> 28

 

Unlike SQL*Plus for PL/SQL, the SQL console of SAP HANA is not a SQL Script runtime shell.

 

- Lars


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>