I would like to know the most efficient way to determine if a Hana table or dataset is empty, within the context of an 'IF' statement.
In the example procedure below I am doing a 'count' but I don't think that can be the most efficient way. I don't know how the SQL 'EXISTS' clause could be used efficiently in an IF clause, or maybe there is some other Hana function?
create procedure blah... AS
BEGIN
declare numrows integer;
mydata = select ...;
select count(*) into numrows from :mydata;
if numrows > 0 then
do some stuff
end if;
END;