检查HANA中存储过程的输入

时间:2017-07-17 09:32:16

标签: sql hana

在存储过程中,我想提供一组输入,其中我也有一些表。

我可以使用if条件来处理空标量输入,但我不知道如何处理空表或输入是否为空。

我想有这样的事情

count = select count(*) from input_table;    
if :count = 0 or not given(~) --how to check if the input is not given?
then
tab = select * from table;
else 
tab = input_table;
end if;

谢谢!

1 个答案:

答案 0 :(得分:0)

select * from Table t1
where exists(
select 1 from ChildTable t2
where t1.id = t2.parentid)
procedure
if exists(select 1 from table)
begin
 -- do stuff
end
相关问题