什么是SAP HANA Database Procedure(数据库过程)
SAP HANA數(shù)據(jù)庫(kù)給開(kāi)發(fā)人員提供了一種編程方式的選擇,能夠在數(shù)據(jù)庫(kù)層直接編寫(xiě)應(yīng)用邏輯。這些應(yīng)用邏輯可以實(shí)現(xiàn)在所謂的數(shù)據(jù)庫(kù)過(guò)程(database procedure)里,實(shí)現(xiàn)語(yǔ)言為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.
我們可以把數(shù)據(jù)庫(kù)過(guò)程簡(jiǎn)單地類(lèi)比成一個(gè)只能進(jìn)行數(shù)據(jù)庫(kù)讀寫(xiě)相關(guān)方面的函數(shù),能接收任意多個(gè)輸入?yún)?shù)和定義輸出參數(shù),存放數(shù)據(jù)庫(kù)操作的結(jié)果。參數(shù)的類(lèi)型既可以是標(biāo)量式類(lèi)型,比如integer, double, varchar等,也可以是table類(lèi)型。
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, 我們可以選擇兩種不同的方式來(lái)實(shí)現(xiàn)數(shù)據(jù)庫(kù)過(guò)程。第一種,即本文標(biāo)題提及的AMDP, 第二種為Xxx, 不在本文討論范圍之內(nèi)。
AMDP, 顧名思義,即在ABAP層進(jìn)行HANA數(shù)據(jù)庫(kù)過(guò)程的實(shí)現(xiàn)和生命周期(lifecycle)的管理。開(kāi)發(fā)人員通過(guò)位于ABAP層的ADT, 編寫(xiě)HANA SQLScript作為AMDP的實(shí)現(xiàn)體,以此達(dá)到在ABAP層直接消費(fèi)HANA數(shù)據(jù)庫(kù)層原生功能的目的。
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.
具體到實(shí)現(xiàn)環(huán)節(jié),在ABAP層內(nèi)何種類(lèi)型的開(kāi)發(fā)對(duì)象里編寫(xiě)HANA SQLScript呢?答案仍然是ABAP類(lèi)的方法內(nèi),只不過(guò)是在一種聲明了特定接口的ABAP類(lèi),用AMDP特定的ABAP關(guān)鍵字修飾的方法內(nèi)。繼續(xù)沿用ABAP類(lèi)方法來(lái)開(kāi)發(fā)AMDP, 使得傳統(tǒng)ABAP應(yīng)用開(kāi)發(fā)人員除了熟悉HANA SQLScript語(yǔ)法外,無(wú)需付出額外的學(xué)習(xí)成本。這種特殊的ABAP類(lèi)方法,作為HANA SQLScript的承載容器,使得AMDP同其他普通的ABAP開(kāi)發(fā)對(duì)象一樣,采取統(tǒng)一的ABAP傳輸管理,生命周期管理,代碼缺陷和升級(jí)管理方式。
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之外,數(shù)據(jù)庫(kù)過(guò)程代理也是另一種HANA數(shù)據(jù)庫(kù)過(guò)程的實(shí)現(xiàn)方式。這種方式首先在HANA repository里創(chuàng)建一個(gè)HANA原生的數(shù)據(jù)庫(kù)過(guò)程,再到ABAP層創(chuàng)建一個(gè)代理指向前者,在ABAP應(yīng)用里通過(guò)使用該代理對(duì)象消費(fèi)HANA倉(cāng)庫(kù)里的原生數(shù)據(jù)庫(kù)過(guò)程。同AMDP相比,這種方式需要在HANA層進(jìn)行原生開(kāi)發(fā),因此在實(shí)際的開(kāi)發(fā)中,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).
總結(jié)
以上是生活随笔為你收集整理的什么是SAP HANA Database Procedure(数据库过程)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 净资产收益率怎么算 净资产收益率计算公式
- 下一篇: SAP AMDP介绍 - ABAP托管的