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

Re: ABAP counterparts in Hana

$
0
0

How about writing a function as follows:

 

CREATE FUNCTION FN_IS_VALID (v_internal_id nvarchar(20))

RETURNS table (a TINYINT) LANGUAGE SQLSCRIPT AS

   v_out tinyint;

BEGIN

if (instr(:v_internal_id, '*')) > 0 or (instr(:v_internal_id, '+*') > 0) then

   v_out := 1;

else

   v_out := 0;

end if;

return select :v_out as a from dummy;

END;

 

You can use the function as follows:

 

select a from FN_IS_VALID('firs*t')

 

In can take the value of a into local variable and use it further.

 

Regards,

 

Ravi


Viewing all articles
Browse latest Browse all 9165

Trending Articles



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