Sunday, November 20, 2022

Oracle Apex Important Question


Oracle Apex Important Question :

  1. Application Processes: Application Processes execute at the same point for every page in the application. However, we can apply conditions for specific pages to control when the process executes. If we want to show some value on every page, then we create an application process.

  2. Application Computation: Application Computation are units of logic that set the value of a single page or application level item and are run at the same point across multiple pages in an application. Like page-level computation, application computation can be based on static value, item value, PLSQL or SQL. Suppose Application Name.

  3. Authentication Schema:  An authentication scheme defines what is required for an authentication process. This includes the following: The login module stack determines whether a user is granted access to an application. The user interfaces are used to gather the information required to authenticate a user.
    • Authentication is the process of establishing user's identities before they can access an applications.
    • Although we can define multiple authentication schemes for your application, only one scheme can be current at a time.
    • The purpose of authentication is to determine the application user identity.
    • Create custom authentication scheme. Create a custom authentication method we must provide a PL/SQL function the Application Express engine executes before processing each page request.The function will return boolean values.

  1. Authorization Schemes: An authorization scheme extends the security of your application's authentication scheme. You can specify an authorization scheme for an entire application, page, or specific control, such as a region, item, or button.
     5.  Apex Collection : 
  • The apex collection is a temporary structure, similar to a temporary table. In  Apex Collection we can store data temporarily and can be posted after the performing validation or calculation during specifice user session. 
  • Collection in Oracle Apex are the temporary storage for the current session, In which you can add the data, access the data, and can do other lots of things.
  • Collections enable we to temporary capture one or more nonscalar values. We can use collections to store rows and columns currently in session state so they can be accessed,manipulated, or processed during user's specific session. 
  • Every collection contains a named list of data elements (or members) which can have up to 50 character attributes(VARCHAR3(4000)), five number attribures, five date attributes one XML type attribute, one large binary attribute(BLOB). We can insert,update,and delete collection information using PL/SQL API APEX_COLLECTION.
         apex_collection.collection_exist(p_collection_name=>'test');
         apex_collection.create_collection(p_collection_name=>'test');
         apex_collection.truncate_collection(p_collection_name=>'test');
         apex_collection.add_member(p_collection_name=>'test');

     6.  What is page 0 in oracle apex?
Page zero acts as a template page for the application. A global page is a special page. Unlike all other processes, validations or branches. It function as a master pages.
  •  Page Zero acts as a template for the application.
  • All components of page Zero will be rendered on all the pages in the application.
  • The following component can be used on page zero: Computation,Branches,Regions(forms,reports,lists and HTML),Items,Dynamic action.
  • Page Zero has no processing part.
Page Item: 
  • Page items are created on page level.
  • An item is part of an HTML form.
  • An item can be a text field,text area,password,select list,check box,and so on.
  • Item attributes affect the display of items on a page.
  • These attributes can impact where a label display, how large an items is.
Application Item :
  • Application Item are created on application level.
  • We have to give name of the Application Item & Scope--Application/Global.
  • If the oracle apex session is shared by more than one application and the Global item's value should be the same for all applications.
  • Application items maintain sesson state.
  • Application items can be set using computations,processes or by passing values on a URL.
  • Application can share the same session if their authentications have the same session cookie attributes. the scope attribute of application items has to be the same across these application.
  • Application level items do not display, but are used as global variavles to the application.
  • Appllication item can not be use in Javascript to get the value.
  • We can use application item as a global variable.
Global Page items:
  • The Global page of application functions as a master page.
  • We can add several globel page for each user interface.
  • The application express engine renders all components we add to a Global page on every page within our application.
Did DML Operation allowed in Materialized view?
Answer: Users can perform DML operations on a writeable materialized view, but if we refresh the materialized view, then these changes are not pushed back to the master and the changes are lost in the materialized view itself.

Faceted Search : Faceted search allows we to filter different columns on the left side of the page and report on the right side of the page, to get only the data that we need.

Error Log: Create Error Log Table Statement
begin
  dbms_errlog.create_error_log (dml_table_name => 'dest');
end;
Create Error Log Table With custom table name:
begin
  dbms_errlog.create_error_log (dml_table_name     => 'dest',
                                err_log_table_name => 'dest_err_log');
end;
Insert Statement:
INSERT INTO TABLE_NAME
                  (UNIQUE_ID, MOBILE_NUMBER, MOBILE_EXCESS_BILL, CREATED_BY)
          VALUES (i.UNIQUE_ID, i.MOBILE_NUMBER, i.MOBILE_EXCESS_BILL, :APP_USER)

         LOG ERRORS INTO ERR$_MOBILE_BILL_EXCESS_EXCEL REJECT LIMIT UNLIMITED;

UPL Structure in Apex:  The sample structure will be :
http://www.gplhrms.com:8080/ords/f?p=100:1:3211767652771:::::
PC Address/Port Number/ords/f?p=Application ID/Page Number/Session ID

Insert data into multiple table using Interactive Grid in Oracle Apex:
Answer: Yes, Possible to insert multiple table from interactive Grid 
but we should get rid of the automatic row processing (created by Apex, by default) and write your own PL/SQL code which would do inserting/updating. Something like an instead-of trigger on a view. Example:
Begin 
  case when :apex$row_status = 'C' then 
         insert into emplocations (employee_id, location_id)
         values (:employee_id, :location_id);
       when :apex$row_status = 'U' then
         update emplocations set
           employee_id = :employee_id,
           location_id = :location_id
           where rowid = :rowid;
       end;
End;  

Instead of Trigger on Views: INSTEAD OF triggers control insert, update, merge, and delete operations on views, not tables. They can be used to make no updateable views updateable and to override the default behavior of views that are updateable. Example:

  CREATE [OR REPLACE] TRIGGER trigger_name
   INSTEAD OF operation (Insert/Update/Delete)
   ON view_name
   FOR EACH ROW
   BEGIN
     ...code goes here...
   END;


Image File store outside of Oracle Database and show image into Apex Application

Directory Create : grant execute on utl_file to HRMS; CREATE OR REPLACE DIRECTORY STOCK_DIRECTORY AS 'C:\Program Files (x86)\Apache Sof...