Aft*_*ock 5 plsql avaloq-script
我遇到过这段代码......这是Pl/Sql吗?你觉得它是什么?
[Script 1.0]
script package up is
import native def_1;
procedure p(
i_g text
)
is
l_txt text;
begin
with mem_m(idx) as msg do
with book_aud(evt_id) as book do
book.upd_pkt(
evt_nr => i__nr
,ref_nr => msg.h.id
,account_nr => msg.h.id
,status => '1'
);
end with;
end with;
end p;
Run Code Online (Sandbox Code Playgroud)
我很惊讶进口和结束;
这不是完整的代码.它是它的简化版本.它还包含熟悉的元素,例如:
c_max constant number := 95;
c_VE_BA constant text := 'A07000';
-- comment
if i_mt is null then
return rpad('/',16);
else
if i_id = zconst_.c_JPY then
l_fmt := '9999999999999999';
else
l_fmt := '9999999999999D99';
end if;
end if;
case i_typ_id
when def_typ.contr then
l_zuonr := zfx2.c_avqt;
when def_typ.fx then
l_zuonr := zfx2.c_avqd;
when def_typ.fxswap then
l_zuonr := zfx2.c_avqd;
when def_typ.forex then
l_zuonr := zfx2.c_avqd;
when def_typ.xfer then
l_zuonr := zfx2.c_avqd;
when def_typ.intr then
l_zuonr := zfx2.c_avqt;
else
assert(false,'Meta Typ');
end case;
Run Code Online (Sandbox Code Playgroud)
它看起来像是Pl/Sql的扩展.根据回复和我自己的研究,我猜它是Avaloq + PL/Sql.我联系了Avaloq,我还在等待正式答复.
它肯定是Avaloq脚本.代码片段是Avaloq编译器编译成PL/SQL的脚本包.Avaloq脚本的要点是禁止直接访问数据库,并使Avaloq产品的定制器改为使用Avaloq API.API是Avaloq脚本语言和一系列其他方式,如设置要加载的规则表或用于定义表单,报告,工作流等的特殊语法,通常允许在其他类型的源中使用Avaloq脚本的片段.
Avaloq脚本有许多PL/SQL元素,但也可以找到一些VB语言概念.以下是代码中的一些注释,以便了解代码的含义.
[Script 1.0] -- Have not seen other than 1.0 version
script package up is -- The PL/SQL package name is going to be s#up
import native def_1; -- import native means a PL/SQL package named
-- def_1 can be used, without native it is
-- another Avaloq script package
procedure p( -- declares a procedure with the name "p"
i_g text -- input variable i_g defined text.
-- in PL/SQL this becomes a VARCHAR2
)
is
l_txt text; -- local variable VARCHAR2(4000) in PL/SQL
begin
with mem_m(idx) as msg do -- mem_m is a DDIC (Data Dictionary)
-- It actually is a kind of "class" with
-- fields and methods
-- "with" is like in VB to avoid writing
-- mem_m(idx) all the time e.g. mem_m(idx).h.id
with book_aud(evt_id) as book do -- book_aud is another DDIC that it is not
-- prefixed with mem implies this is not a
-- in memory structure but direct access
-- to a Oracle table book_aud with index
-- evt_id which looks undefined to me and
-- should bring a compiler error
book.upd_pkt( -- method call in the book_aud DDIC
evt_nr => i__nr -- like in PL/SQL named parameters
,ref_nr => msg.h.id
,account_nr => msg.h.id
,status => '1'
);
end with;
end with;
end p;
Run Code Online (Sandbox Code Playgroud)
我也可以评论上面的其他代码片段,但我认为你已经得出了一般概念.在我正在使用的Avaloq版本中,mem_m和book_aud都不是已知的DDIC,不知道你从哪里得到它.由于你的帖子已经很多年了,我想这是一个非常古老的Avaloq版本.