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

Convert SQL to CE Function

$
0
0

How can i convert the below sql statement into Hana SQLSCRIPT. Can we use 3 tables in the CE_JOIN

 

 

select

e.ID,e.NAME,e.LAST_NAME,r.role,n.name,

                              ( 0.998 * e.ID - 1 ) as CALCU

from employee e,role r, new_employee n

where e.role_id = r.role_id and e.role_id = n.role_id

 

I need something like in this format.

 

CREATE PROCEDURE ProcWithResultView(IN lt_employee EMPLOYEE,IN lt_role ROLE, IN lt_new_employee NEW_EMPLOYEE,

OUT EMPLOYEE_ROLE EMPLOYEE_ROLE)

LANGUAGE SQLSCRIPT READS SQL DATA WITH RESULT VIEW ProcView AS

BEGIN

EMPLOYEE_ROLE = CE_JOIN(:lt_employee,:lt_role,:lt_new_employee,["ROLE_ID"],["NAME","LAST_NAME","ROLE_ID","ROLE","0.998 * 'ID' -1" as CALCU]);

END;

SELECT * FROM ProcView WITH PARAMETERS

('placeholder'=('$$lt_employee$$','EMPLOYEE'),

'placeholder'=('$$lt_role$$','ROLE'),

'placeholder'=('$$lt_role$$','NEW_EMPLOYEE'));


Viewing all articles
Browse latest Browse all 5653

Trending Articles



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