-- run 1_datatype_data.sql before running this script
ALTER SESSION SET CURRENT_SCHEMA = SqlScriptDocumentation;

drop procedure dynamic_sql_proc;
CREATE PROCEDURE dynamic_sql_proc LANGUAGE SQLSCRIPT AS
v_sql1   VARCHAR(1024);
v_sql2   VARCHAR(1024);
v_msg    VARCHAR(200);
BEGIN
init_proc();

v_sql1 := 'INSERT INTO "MESSAGE_BOX" VALUES (''First message from Dynamic SQL'', SYSTIMESTAMP)';
EXEC :v_sql1;

v_sql2 := 'INSERT INTO message_box VALUES (''Second message from Dynamic SQL'', SYSTIMESTAMP)';
EXEC :v_sql2;

v_sql1 := 'Third message from Dynamic SQL';
EXEC 'INSERT INTO message_box VALUES (''' || :v_sql1 || ''', SYSTIMESTAMP)';

call dynamic_sql_proc();
select message from message_box;

专注于企业信息化,最近对股票数据分析较为感兴趣,可免费分享股票个股主力资金实时变化趋势分析工具,股票交流QQ群:457394862
分类: SAP HANA 本文转自沧海-重庆博客园博客,原文链接:http://www.cnblogs.com/omygod/archive/2013/04/25/3043788.html,如需转载请自行联系原作者
SAP HANA Database Explorer 里的 SQL 语句如何排错 trouble shoot
SAP HANA Database Explorer 里的 SQL 语句如何排错 trouble shoot
一个问题:CDS view在HANA studio里执行,显示的耗时比在ABAP open SQL里少
一个问题:CDS view在HANA studio里执行,显示的耗时比在ABAP open SQL里少