Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

Quickest way to check if a Hana table is empty

$
0
0

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;


Viewing all articles
Browse latest Browse all 5653

Trending Articles



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