Showing posts with label Article. Show all posts
Showing posts with label Article. Show all posts

Thursday, 2 January 2020

Perform Dynamic DLL in Oracle


EXECUTE IMMEDIATE statement can be used to execute dynamic SQL statements.

Syntax: EXECUTE IMMEDIATE 'User_Code';

--
-- Create/Drop Table using this PLSQL Script or Procedure
-- DLL Script
-- by mfaisal 02-Jan-2020

Declare
---Create
begin
  execute immediate 'CREATE TABLE X_DDL_ON_APPS (APPS_ID NUMBER)';
end;


Declare
--Drop with Oracle EBS Package
begin
  system.ad_apps_private.do_apps_ddl(schema_name => 'APPS',
                                     ddl_text => 'DROP TABLE X_DDL_ON_APPS ');
end;


Wednesday, 20 November 2019

Print Function for PLSQL Testing

For tracing PLSQL code , Print function  show output in DBMS Output as per Arguments.

1) For implementation of  this function simply add G_Debug_Enabled Variable and Function Specification in your package Specification. For enable tracing set G_Debug_Enabled as True before execute your code.

  G_Debug_Enabled Boolean default false;
    procedure print(pString in varchar2
                , pText_1 in varchar2 default null
                , pValue1 in varchar2 default null
                , pText_2 in varchar2 default null
                , pValue2 in varchar2 default null
                , pText_3 in varchar2 default null
                , pValue3 in varchar2 default null
                , pText_4 in varchar2 default null
                , pValue4 in varchar2 default null
                , pText_5 in varchar2 default null
                , pValue5 in varchar2 default null
                , pText_6 in varchar2 default null
                , pValue6 in varchar2 default null
                , pText_7 in varchar2 default null
                , pValue7 in varchar2 default null
                , pText_8 in varchar2 default null
                , pValue8 in varchar2 default null
                , pText_9 in varchar2 default null
                , pValue9 in varchar2 default null
                );

procedure test_Print_function;

2) Add Function Body in Package Specification Body


procedure print(pString in varchar2
                , pText_1 in varchar2 default null
                , pValue1 in varchar2 default null
                , pText_2 in varchar2 default null
                , pValue2 in varchar2 default null
                , pText_3 in varchar2 default null
                , pValue3 in varchar2 default null
                , pText_4 in varchar2 default null
                , pValue4 in varchar2 default null
                , pText_5 in varchar2 default null
                , pValue5 in varchar2 default null
                , pText_6 in varchar2 default null
                , pValue6 in varchar2 default null
                , pText_7 in varchar2 default null
                , pValue7 in varchar2 default null
                , pText_8 in varchar2 default null
                , pValue8 in varchar2 default null
                , pText_9 in varchar2 default null
                , pValue9 in varchar2 default null
                )
    is
    begin
            if G_Debug_Enabled then
               Dbms_output.put_line('$ '||pString||' : '||pText_1||'  => '||pValue1||' '||pText_2||' => '||pValue2||' '||pText_3||' => '||pValue3||' '||pText_4||' => '||pValue4||' '||pText_5||' => '||pValue5||' '||pText_6||' => '||pValue6||' '||pText_7||' => '||pValue7||' '||pText_8||' => '||pValue8||' '||pText_9||' => '||pValue9);
              end if;
      end;


procedure test_Print_function

  is
  begin
          print('Function Test','TransactionID',10,'EmployeeName','mFaisal');
    end;



3) Now test test_print_function


begin

  -- Call the procedure
  PKG_wf_api.G_Debug_Enabled:=true;
  PKG_wf_api.test_print_function;
end;


Output: 
$ Function Test : TransactionID  => 10 EmployeeName => mFaisal  











first_rule of "The Forty Rules of Love"

#first_rule

"How we see God is a direct reflection of how we see ourselves.
If God brings to mind mostly fear and blame, it means there is too much fear and blame welled inside
us. If we see God as full of love and compassion, so are we.”

OADBTransactionImpl in Oracle Application Framework (OAF)

OADBTransactionImpl is a class in Oracle Application Framework (OAF), which is a framework for building Oracle E-Business Suite applications...