什么是SAP HANA Database Procedure(数据库过程)
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).
總結
以上是生活随笔為你收集整理的什么是SAP HANA Database Procedure(数据库过程)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 净资产收益率怎么算 净资产收益率计算公式
- 下一篇: 抖音石头剪刀布一把十手倒过来念是什么梗