SAP HANA 8. SQLScript Basic 之 Create an SQLScript Procedure with SELECT Statement

原创 2013年12月02日 11:13:50

1、新建文件NewFile 创建get_bp_addresses_by_role_sql.procedure

计算机生成了可选文字: SAp日ANAoeve颐亩沁C:吧冲肠口口口目翻巨con、o'ei一sAp日丽入studio】五FileEdit',州gatesearchp:列ectRunwindowr。{肖,图励已}争,O,甲,}勿,御,令中,吓〔x-n,霜抓,sAp"ANAR二石‘"6"'',SAp"ANA'卜涵而d·,·石蔽丽百赢福石石蔽石蔽万一甩NewrileqI.procedure,alreadyexist,.F:initializingteamprovider]M,'Workshop.,e,:iona.00,)]刁回氢·砺opensApl[HDB(sYSTEM,'workshop.sessiona.oo')],吐JavascriptRe,ouroe,〔,身data‘岛model,比get--bp_addresses_b犯role_sql.proced。reO·xsaccess睡己·xsapp目·x,privileges〔·殴RetrieveData.xsjsFIIename:get--bP-addresses_by--role-sql.procedure}Ad一d二1位}r'n,snJ(c"nce'J

 

2Local Table Type中定义本地类型

/*
You can create new table types and use them as input and output parameters in a procedure.
The table types must be defined using SQL syntax, for example:
CREATE TYPE <Type Name> AS TABLE (<filed Name1> <Filed Type1>, <filed Name2> <Filed Type2>,...).
*/
create type tt_bp_addresses as table (
PartnerId nvarchar(10),
PartnerRole nvarchar(3),
EmailAddress nvarchar(255),
CompanyName nvarchar(80),
AddressId nvarchar(10),
City nvarchar(40),
PostalCode nvarchar(10),
Street nvarchar(60)
)

计算机生成了可选文字: 乙‘ApHANADeve,opmen,瓜‘AP学习资料\HAN从c'ouds卜areRepo、‘,o州orks卜op\、e、,'ona\0o\mode's\get--bn--addre,、e、一呱ro,e一sq‘·prooedure一S丽HANAStud‘。1口『月口口口口口口口口FIIeEditNavigateSearchprojectRunWindowHelp:r当,履自}争,O,甲,i勿甲xplore。小吃弘p日ANARep。,;tor;g'甲令中甲甲,'SAp"ANAs'"'m尽宁get-bp一dd『e,,e,一b二『o'e-,q’·p『oCedu『e备心巴HOB一“QL鱼n,o'elHDB(SYSTEM)uvolbawcub45qagPtgu.vm.cld.sroo司曰sAp日ANA口〔良sQLscri醉一Local丁able砂pes…/*'Youcancreatenewtabletypesandusethemasinputandoutputparametersinaprocedure.ThetabletypesoustbedefinedusingSQLsyntax,forexaople:cREATEWPE<TypeNaoe>ASTABLE(<filedNamel><FiledTypel>,<filedNameZ><FiledTypeZ>,…).*/createtypett_bp_addressesastable(partner工dnvarchar(le),partnerRolenvarchar(3),巨。ai1Addressnvarchar(255),CoopanyNamenvarchar(se),Address工dnvarchar(10),citynvarchar(姆),postalcodenvarchar(10),Streetnvarchar(6e))!蜡卜eIloodata〔Errorwhileinitializingteamprovider]」砺opensApl【HDB(sysTEM,'works卜op.se、siona.oo')]卜以JavascriptRe,ource,卜身data‘身model,比get--bp一ddresse,_b火role_,ql.procedure昆.x,acce,,盛己·xsapp比·x,privilege,。,吩RetrieveData.xsjs

 

3SQLScript Tab页中代码创建Procedure

CREATE PROCEDUREget_bp_addresses_by_role_sql (
    in partnerrole nvarchar(3),
    out bp_addresses tt_bp_addresses
)
LANGUAGESQLSCRIPT
SQLSECURITY INVOKER
READSSQL DATA AS
BEGIN
/*****************************
Writeyour procedure logic
 *****************************/
 bp_addresses =
selecta."PartnerId", a."PartnerRole", a."EmailAddress",a."CompanyName",
a."AddressId",b."City", b."PostalCode", b."Street"
from"SAP_HANA_EPM_DEMO"."sap.hana.democontent.epm.data::businessPartner"as a
inner join"SAP_HANA_EPM_DEMO"."sap.hana.democontent.epm.data::addresses"as b
ona."AddressId" = b."AddressId"
wherea."PartnerRole" = :partnerrole;
END;


计算机生成了可选文字: 圃瓜百日ANAoevelopment下石属药资料\日ANA\clouds卜areRepository\Workshop\sessiona\0o\models\oet--b"ddresses_by--role--sol.procedur。一;Ap日ANAstudi。11一。FileEditNavigate;肖,,履自石project〔xpl。rerSearchproject代unwindowHelp}争,O,:甲,l翻,御,令中,,醋{9SAp日A,吃sAp日ANARepo,ito'e‘零SAp"ANAS""m粼l序get-bp_addresse,一犯ro!e-sql.procedure面荟巴”HD”一SQLCO·’o'e'·猎helloodata[Errorw卜ileinit;alizingteamprovider]。砺opensApl[HDB(sYSTEM.'Workshop.,essiona.oo')]、峨JavascriptRe,ouroe,〔,身data‘岛model,比get--bp_addresses_b犯role_sql.proced。reO·xsaccess以己.xsapp匕。·xsprivileges:·图RetrieveData.xsjsHDB(SYSTEM)uvolbawcub45qagptgu.vm.cld.,roosQLscr'p,l巨,Tab,e砂pes…cR〔A下〔pRoc〔ouREget_bp_addresses_by--role_sql(inpartnerrolenvarcha。(3),outbP--addressestt_bp_addresses)LAN石UAGESQLSCRIPTSQLSECURITYINVOKERREADSSQLDATAASBEGIN出出介右出水众水水出水水水水水冲‘犷尸iteyourprocedurelogic东沐.东军率率宋水木宋出*************,bp_addresses=selecta."Partnerld'",a."PartnerRole'",a."Emai执ddress",a.'"Addressld",b."city'",b.'"Postalcode",b."Street'"fr俪”SAP_HANAeeEP州eeDE阳”."5ap.hana.de帕content.epm.data::innerjoin"SAP_印幼叭‘EP性DE阳”."sap.hana.deocontent.epo.ona。”Addressld”二b。”Addressld"wherea."PartnerRole"=:partnerrole二a."company卜通ame",bUSineSSP己rtner'.己S己dat日::addreSSeS'.asbEND;l

 

4TeamCommit& Activate之后,在SQL Console中调用代码,生成procedure,如下图所示:

call"_SYS_BIC"."WorkShop.sessiona.00.models/get_bp_addresses_by_role_sql"(
partnerrole =>'02', bp_addresses => ? )
 
 

计算机生成了可选文字: Filer全EditNavigateSearchprojectRunWindowHelp,图履已ojectExplorer}争,O,:甲,{勿,御,令中,,弘p目ANARepo、;to'e}?.,。Ap日ANAsy耽em,奢东鲁砂i竺呼于‘碗’'p一ddres·es-bv-」面曰兰三圣1)HD'(SYST七M)uvolbawcub45qagptgu·Vm·cld·,r…entschema'HDB一SQLCon,olel跳气l回日,趾-SA几HANA--EpM_DEMO)。息HDB(SYSTEM)SApHANACloudS卜areTe、t幽Backup全Catalog.己publlcSynonyms少侣HELLO-OOATA[>侣SAp一ANA--EpM_DEMO,侣sAp-XS_LM侣SYS侣SySTEM侣UIS名WORKSH0pA-00侣_SYS_BI‘侣一YS_BIC[‘才ColumnViews己Functions已Indexe,‘匕二procedures己TableTypes咙workshop.、es、iona.oo.model,/get-bp_addres、e,_b犯role_,ql二,Sequences[,臼Synonym,[>臼Tablest)臼Trigger,l;l~‘示eS网___1lllcall"_SYS_BIC".”湘rkshop.seSSiona矗!0…邑中,中,.OO.models/get_bp_addre:、es_by--role_sql"(partnerrole=>'02',bp_addresses=>于partnerldpartnerRo!e123456EmaiiAddre、,CompanyNamedagmar.,chulze@beckerberlin.deBeckerBerlinfranklinjones@pear一computing.compearComputingServicesigor.tarassow@retc.ruRussianElectronicTrad…ant卜ony.lebouef@crtu.caC.R.T.U.sunita一kapoor@it一trade.inIndianITTradingCom…pawel一lewando,ki@ca任.plChemiaATechnicznieF…Addres'Id1创X心0D0351O(犯000)试1侧X心00DS41创X心000631侧X心000731创X沦00074CityBerlinAtlant之Mosk之Montr,MumbWar'cl一』一‘一successfullyexecutedretched6r洲(s)ineinlII5470ms82卜s111829ps(serverprocessingms331(serverprocessingt场e:et伽e:115ms。“s)目p『oblems跳\\旦propertiesH{story二J‘山一一压口、,竺__卜s),一,口列

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

SAP HANA 10. Create an SQLScript Procedure with Imperative Logic

SAP HANA SQLScript 的 Imperative Logic 包括 IF+ELSE+ENDIF 、while循环、For循环、 Case等。   1、新建文件NewFil...

SAP HANA 9. SQLScript Basic 之 Create an SQLScript Procedure with Calculation Engine (CE) Functions

采用CE(Calculation Engine)执行SAP HANA 8 相同的功能,比较两者区别,执行效率。   1、新建文件NewFile 创建get_bp_addresses_by_role_...

HANA 基础SQL和SQLScript

本文由一位前辈总结的sql语法  希望对大家有用 第一天:(sql) 1. DDL(定义),DML(操作),DCL(控制) 2. DATA TYPE 和操作符 3. DDL ·表名应尽量为大...

In-memory Computing with SAP HANA读书笔记 - 第一章:Basic concepts of in-memory

本文为In-memory Computing with SAP HANA on Lenovo X6 Systems第一章Basic concepts of in-memory computing的读书...

asp.net sqlscript

  • 2007-07-14 10:43
  • 226KB
  • 下载

In-memory Computing with SAP HANA读书笔记 - 第三章:Software components and data replication methods

本文为In-memory Computing with SAP HANA on Lenovo X6 Systems第三章Software components and data replication...

using sap businessobjects predictive analytics with sap hana express edition

https://blogs.sap.com/2017/03/07/using-sap-businessobjects-predictive-analytics-with-sap-hana-expres...

Preview of BI 2012 with Speaker Dan Kearnan: Expect SAP NetWeaver BW to Run Soon on SAP HANA

Right now, you might think of SAP HANA as a means to speed up information analysis — but by mid-year...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)