前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >什么是SAP HANA Database Procedure(数据库过程)

什么是SAP HANA Database Procedure(数据库过程)

作者头像
Jerry Wang
发布2020-07-06 10:50:20
8800
发布2020-07-06 10:50:20
举报

SAP HANA数据库给开发人员提供了一种编程方式的选择,能够在数据库层直接编写应用逻辑。这些应用逻辑可以实现在所谓的数据库过程(database procedure)里,实现语言为SAP HANA SQLScript.

The SAP HANA database comes with a variety of programming options for application logic at the database level. The database procedures (which are used to implement the application logic) can be written as queries that follow the SAP HANA database SQLScript syntax.

我们可以把数据库过程简单地类比成一个只能进行数据库读写相关方面的函数,能接收任意多个输入参数和定义输出参数,存放数据库操作的结果。参数的类型既可以是标量式类型,比如integer, double, varchar等,也可以是table类型。

Database procedures can have multiple input parameters and output parameters; these are either of scalar (such as integer, double, varchar) or table type. Using ADT tools, you can implement HANA database procedures by means of…

使用ABAP Development Tool, 我们可以选择两种不同的方式来实现数据库过程。第一种,即本文标题提及的AMDP, 第二种为Xxx, 不在本文讨论范围之内。

AMDP, 顾名思义,即在ABAP层进行HANA数据库过程的实现和生命周期(lifecycle)的管理。开发人员通过位于ABAP层的ADT, 编写HANA SQLScript作为AMDP的实现体,以此达到在ABAP层直接消费HANA数据库层原生功能的目的。

The basic idea of AMDP is to manage HANA procedures and their lifecycle inside the ABAP server. To allow native consumption of HANA features from within the ABAP layer, the HANA database procedure language SQLScript has been integrated into the ABAP stack.

具体到实现环节,在ABAP层内何种类型的开发对象里编写HANA SQLScript呢?答案仍然是ABAP类的方法内,只不过是在一种声明了特定接口的ABAP类,用AMDP特定的ABAP关键字修饰的方法内。继续沿用ABAP类方法来开发AMDP, 使得传统ABAP应用开发人员除了熟悉HANA SQLScript语法外,无需付出额外的学习成本。这种特殊的ABAP类方法,作为HANA SQLScript的承载容器,使得AMDP同其他普通的ABAP开发对象一样,采取统一的ABAP传输管理,生命周期管理,代码缺陷和升级管理方式。

AMDP is implemented in ABAP class methods (so-called AMDP methods) that serve as a container for SQLScript code. This approach offers many significant advantages:

  • It enables the shipment of AMDP in the same way as any other ABAP development object (lifecycle management)
  • It allows you to implement and ship corrections for AMDPs, just like it is possible for ABAP classes, including SAP Note support (supportability and extensibility).

除了AMDP之外,数据库过程代理也是另一种HANA数据库过程的实现方式。这种方式首先在HANA repository里创建一个HANA原生的数据库过程,再到ABAP层创建一个代理指向前者,在ABAP应用里通过使用该代理对象消费HANA仓库里的原生数据库过程。同AMDP相比,这种方式需要在HANA层进行原生开发,因此在实际的开发中,SAP更推荐使用AMDP.

Using an implemented database procedure in the HANA repository, you have the option to create a corresponding proxy that is stored in the ABAP repository. The proxy represents the HANA database procedure interface in relation to ABAP programs. CautionABAP-Managed Database Procedures is recommended instead of calling SQLScript procedures using database procedure proxies. AMDP is the replacement technology for database procedure proxies. The use of database procedure proxies will only be required in the particular case where a secondary database connection is used to access the SAP HANA database, which is not the central database of the AS ABAP (side-by-side scenario).

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-07-03 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
对象存储
对象存储(Cloud Object Storage,COS)是由腾讯云推出的无目录层次结构、无数据格式限制,可容纳海量数据且支持 HTTP/HTTPS 协议访问的分布式存储服务。腾讯云 COS 的存储桶空间无容量上限,无需分区管理,适用于 CDN 数据分发、数据万象处理或大数据计算与分析的数据湖等多种场景。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档