码迷,mamicode.com
首页 > 数据库 > 详细

HANA SQL Script学习(1):Orchestration Logic

时间:2020-12-03 11:43:29      阅读:10      评论:0      收藏:0      [点我收藏+]

标签:values   sele   varchar   reads   ati   RoCE   procedure   where   nbsp   

4.SAP HANA SQL Script

4.1 Orchestration Logic

1.Orchestration Logic

示例:orchestrationProc

CREATE PROCEDURE orchestrationProc
 LANGUAGE SQLSCRIPT
 READS SQL DATA AS
 BEGIN       
       DECLARE v_id BIGINT;       
       DECLARE v_name VARCHAR(30);       
       DECLARE v_pmnt BIGINT;       
       DECLARE v_msg VARCHAR(200);    
DECLARE CURSOR c_cursor1 (p_payment BIGINT) FOR SELECT id, name, payment FROM control_tab WHERE payment > :p_payment ORDER BY id ASC;
OPEN c_cursor1(250000); FETCH c_cursor1 INTO v_id, v_name, v_pmnt; v_msg = :v_name || (id || :v_id || ) earns || :v_pmnt || $.; CALL ins_msg_proc(:v_msg); CLOSE c_cursor1; END

procedure :ins_msg_proc

--创建message表
CREATE TABLE message_box (p_msg VARCHAR(200), tstamp TIMESTAMP);

--创办procedure
CREATE PROCEDURE ins_msg_proc (p_msg VARCHAR(200))
 LANGUAGE SQLSCRIPT AS
 BEGIN   
       INSERT INTO message_box VALUES (:p_msg, CURRENT_TIMESTAMP);
 END;

 

HANA SQL Script学习(1):Orchestration Logic

标签:values   sele   varchar   reads   ati   RoCE   procedure   where   nbsp   

原文地址:https://www.cnblogs.com/tangToms/p/14053729.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!