Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this code written in Pl/Sql, and if not, then what language is it?

I have encountered this code... Is this Pl/Sql? What do you think it is?

[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; 

I am surprised by import and end with;

It is not the full code. It is reduced version of it. It also contained familiar elements such as:

   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;

It looks like an extension of Pl/Sql. Based on the responses and my own research, I guess it is Avaloq+PL/Sql. I contacted Avaloq,I am still waiting for official answer.

like image 627
Aftershock Avatar asked Jul 09 '09 17:07

Aftershock


People also ask

Is PL SQL a programming language?

PL/SQL is a powerful, yet straightforward database programming language. It is easy to both write and read, and comes packed with lots of out-of-the-box optimizations and security features.

How do I write if else condition in Oracle?

Syntax (IF-THEN-ELSIF-ELSE) The syntax for IF-THEN-ELSIF-ELSE in Oracle/PLSQL is: IF condition1 THEN {... statements to execute when condition1 is TRUE...}


2 Answers

It looks like Avaloq Script, used by (ahem) Swiss banks, and while there is very little about it online, I found a grammar which perfectly matches the terms in your samples.

Avaloq Script, the Avaloq Banking System's script language, facilitates entering specific business logic. The structure of the data that can be accessed through Avaloq Script is defined in a DDIC (Data Dictionary), making it unnecessary to know the data storage structure.

like image 167
crb Avatar answered Oct 11 '22 13:10

crb


yes it is avaloq script. its some kind of pl/sql pre compiler, you should be able to find a package called s#up where the real pl/sql code resides.

like image 20
christian Avatar answered Oct 11 '22 13:10

christian