Search This Blog

Thursday, January 16, 2020

PRAGMA AUTONOMOUS_TRANSACTION

PRAGMA AUTONOMOUS_TRANSACTION is a Seen Text what make sub program successful even the main program got Rollback in Oracle PL/SQL. Normally we may use this Seen Text in Functions , Procedures , Trigger which we call in the PL/SQL block as a sub Program/Transaction. 1. Mainly PRAGMA AUTONOMOUS_TRANSACTION use to keep log at the middle of a PL/SQL Transaction block. To Know More and With Example You Can Visit This URL : PRAGMA AUTONOMOUS_TRANSACTION PRAGMA AUTONOMOUS_TRANSACTION  is a Seen Text what make sub program successful  even the main program got Rollback in Oracle PL/SQL. Normally we may use this Seen Text in Functions , Procedures , Trigger which we call in the PL/SQL block as a sub Program/Transaction.



1. Mainly PRAGMA AUTONOMOUS_TRANSACTION use to keep log at the middle of a PL/SQL Transaction block.

To Know More and With Example You Can Visit This URL :   PRAGMA AUTONOMOUS_TRANSACTION

CREATE AND DROP ACL VERSION 2

SELECT ACL

SELECT host,
       lower_port,
       upper_port,
       ace_order,
       TO_CHAR(start_date, 'DD-MON-YYYY') AS start_date,
       TO_CHAR(end_date, 'DD-MON-YYYY') AS end_date,
       grant_type,
       inverted_principal,
       principal,
       principal_type,
       privilege
FROM   dba_host_aces

ORDER BY host, ace_order;
CREATE ACL

BEGIN
  DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(acl         => 'www.xml',
                                    description => 'WWW ACL',
                                    principal   => 'PUBLIC',
                                    is_grant    => true,
                                    privilege   => 'connect');

  DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl       => 'www.xml',
                                       principal => 'PUBLIC',
                                       is_grant  => true,
                                       privilege => 'resolve');

  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(acl  => 'www.xml',
                                    host => '*');
END;
/
COMMIT;


DROP ACL

BEGIN
  DBMS_NETWORK_ACL_ADMIN.drop_acl (
    acl         => 'www.xml');

  COMMIT;

END;

Json Parsing Using Json Table in PLSQL Oracle 12c Release 1

DECLARE
V_JSON VARCHAR2(4000);
ECO VARCHAR2(3000);
BEGIN
/*
{
"ChallanNo":"2020-0000000047",
"RefNo":"1234567",
"BankBranchNameEn":"BANK ASIA LTD., HEAD OFFICE",
"BankBranchNameBn":"BANK ASIA LTD., HEAD OFFICE",
"ClientNameEn":"Md Zafar Iqbal Edit",
"ClientNameBn":"মোঃ জাফর ইকবাল আপডেট",
"Amount":3450.0,
"ChallanEconomic":[
{
"EconomicCode":"1422311",
"EconomicNameEn":"Passport fee",
"EconomicNameBn":"পাসপোরà§à¦Ÿ ফি",
"ChallanSubNo":"01",
"Amount":3000.0
},
{
"EconomicCode":"1141102",
"EconomicNameEn":"Supplementary duty on domestically produced commodities",
"EconomicNameBn":"দেশজ উৎপাদিত পণà§à¦¯à§‡à¦° ওপর সমà§à¦ªà§‚রক শà§à¦²à§à¦•",
"ChallanSubNo":"02",
"Amount":450.0
}
],
"SuccessFlag":"Y"
}
*/
  SELECT a.JSON_RESPONSE.ChallanEconomic.EconomicCode
     INTO eco
     FROM
     IN_OUT_JSON a
    WHERE REQUESTID = 27;

   eco := LTRIM (RTRIM (eco, ']'), '[');

   FOR FOO IN (    SELECT REGEXP_SUBSTR (eco,
                                         '[^,]+',
                                         1,
                                         LEVEL)
                             TXT
                     FROM DUAL
               CONNECT BY REGEXP_SUBSTR (eco,
                                         '[^,]+',
                                         1,
                                         LEVEL)
                             IS NOT NULL)
   LOOP
      DBMS_OUTPUT.PUT_LINE (FOO.TXT);
   END LOOP;
END;

Saturday, January 11, 2020

Multiple Process Execute On Same Button Problem In Oracle Apex

When we try to execute multiple process on same button there is may problem arise from oracle apex. Error would be like Jquery from apex builtin library file. We can get the error from browser inspect and console .

Solve : Goto to Page Properties >>  Advance >> Reload On Submission >> Always

Restrict File Upload by File Type in Oracle Apex

If you want to restrict file upload by file type/extension/format you can follow the below steps.  Goto File Browser Item --> Advanced --...