Wednesday 30 September 2015

Find all tables in db with column name of a particular string.

Simple Steps to Do!!

Without System Privileges :
select table_name from all_tab_columns where column_name='THE_COLUMN_YOU_LOOK_FOR';
With System Privileges:
select table_name from dba_tab_columns where column_name='THE_COLUMN_YOU_LOOK_FOR';

Thursday 24 September 2015

Change default (first) page in Apex

When you make your first application in APEX you typically have as default page 1 or the login page (101). If you want to change your default (first) page you need to have a look at three different places. Let's say we want to have page 9 as default page:

1) Application Builder > Your Application > Page 101 > Processes (Page Processing) > Login
Change Process to:
 wwv_flow_custom_auth_std.login(
   P_UNAME       => :P101_USERNAME,
   P_PASSWORD    => :P101_PASSWORD,
   P_SESSION_ID  => v('APP_SESSION'),
   P_FLOW_PAGE   => :APP_ID||':9'
   );
Whenever somebody logs in we want him to go to page 9.

2) Shared Components > Security > Authentication Schemes > Your AuthenticationChange the Logout URL: wwv_flow_custom_auth_std.logout?p_this_flow=&APP_ID.&p_next_flow_page_sess=&APP_ID.:9
If somebody logged out, we set the default page to 9 as that's our default page.

3) Shared Components > Security > Edit Security AttributesChange the Home Link to: f?p=&APP_ID.:9:&SESSION.
If no page is specified this is the page to go to for ex. f?p=100 means we're going to application 100 with as default page, the page specified in the Home Link. You can also reference this url by #HOME_LINK#.

Thursday 3 September 2015

ACL in Oracle

The DBMS_NETWORK_ACL_ADMIN package provides the interface to administer the network Access Control List (ACL).

Oracle Database provides classic database security such as row-level and column-level secure access by database users. It also provides fine-grained access control for table data and for resources in Oracle XML DB Repository, for secure access by Oracle Fusion users (who are not necessarily database users). This chapter describes the access control lists and security classes that allow such fine-grained access control. It includes how to create, set, and modify ACLs and how ACL security interacts with other Oracle Database security mechanisms.

For More Detail Visit: http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_networkacl_adm.htm

BEGIN
  DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(acl         => 'www.xml',
                                    description => 'WWW ACL',
                                    principal   => 'SCOTT',
                                    is_grant    => true,
                                    privilege   => 'connect');
 
  DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl       => 'www.xml',
                                       principal => 'SCOTT',
                                       is_grant  => true,
                                       privilege => 'resolve');
 
  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(acl  => 'www.xml',
                                    host => 'www.us.oracle.com');
END;
/
COMMIT;

java script calculation in tabular form



Today i found very interesting Question on Apex forum

Question:

Java script Calculation in Tabular form apex oracle 5.0
So, basically it something like there are multiple columns and each column will have numeric and character values.We need to calculate numeric values and give its particular output(result).

Java script:

  1. sal=  (parent_row.find('input[name=f05]').val().replace(/,/g,'') == ' ') ? 0 : 
  2. parseFloat(parent_row.find('input[name=f05]').val().replace(/,/g,'') );     

Everything else remain same.



Wednesday 2 September 2015

How to add Logo and Text in your Page(region)

I just found this question on apex oracle forum and its quite interesting too.
Question :

So, basically there is one logo,some random text and report on same page.


and we said...
demo

SHA - 512 error workaround

Error : Pages with checksum required produce error: The cryptographic function "SH512" is not supported on this system

Solution:
This is basically happens when-ever you are migrating your application from Cloud base to Local Server.Due to change in EPG and Apex version.
Make sure you are running same version of oracle.

Example:
Cloud : www.apexoracle.com (cloud) uses 12 c Enterprise Edition and Apex oracle 5.0
Local Server : Apex verion < 5.0 and Sql <12 then above error will popup

So basically make sure Apex version and database version are same on local system then you are good to go else you have to make changes in LOCAL APEX 5.0.

You have to go to Shared Components > Security Attributes and click on the Expire Bookmarks button, where you can change the algorithm.

LinkedIN

Enable - Disable items in apex oracle


Mainly two ways for disabling your Item in apex oracle.
Demo

* create Dynamic action for Item

      select which item you want to Disable in Dynamic action. By following given methods in demo

* Just put READONLY in Edit item Html Attributes.

Which one is more preferable!!!
    So, basically both will work as shown in demo but when ever you want to submit your page values(reports,forms) then Readonly will allow us to submit values to the database.
  If you disable items using Dynamic action then that items will be dead for apex and it will not allow us to submit it.


Tuesday 1 September 2015

Known Issues - Application Express 5.0.1

Known Issues - Application Express 5.0.1:

Application Express 5.0.1 was released on July 15, 2015.
REF: http://www.oracle.com/technetwork/developer-tools/apex/downloads/apex-501-known-issues-2606305.html
  • 21469957 - ORA-14552 BECAUSE OF LOV QUERY WITH BIND VARS IN CLASSIC REPORT
    When running a classic report that includes a call to apex_item.select_list_from_lov, the report fails with ORA-14552 if the LOV definition contains a bind variable.
    Solution: There is a patchset exception for this available on My Oracle Support - search by bug number.
  • 21537995 - STATIC IMAGES BROKEN FOR OLD WORKSPACES WHEN USING APEX 5.0 AND ORDS 3
    If an instance has workspaces that were created before Application Express 4.1 and Oracle REST Data Services 3 is being used, static image links will not be displayed.
    Solution: There is a patchset exception for this available on My Oracle Support - search by bug number.
  • 21501621 - CHANGE WORKSPACE IN DEV ENV AUTOMATICALLY LOGS IN TO SAME WORKSPACE
    After applying the 5.0.1 patch, Change Workspace (which is available for header based authentication and single sign-on) in the development environment automatically logs in to the same workspace again.
    Solution: There is a patchset exception for this available on My Oracle Support - search by bug number.
  • 21479385 - SAMPLE GEOLOCATION LOCATION SHOWCASE ALWAYS INDICATES NO HTTP ACCESS
    In APEX 5.0.1, even when network HTTP access is configured properly, the Sample Geolocation Showcase application will display the "No HTTP access to Elocation Geocoder Service” notification.
    Solution: There is a patchset exception for this available on My Oracle Support - search by bug number.
  • 21473086 - PKGAPP: LIVEPOLL AUTHENTICATED POLLS DON'T WORK 
    In APEX 5.0.1, the LivePoll packaged application has a potential infinite redirect loop when a user tries to access a poll which requires authentication, preventing users from completing these sorts of polls.
    Solution: There is a patchset exception for this available on My Oracle Support - search by bug number.
  • 21464312 - ORA-02091: TRANSACTION ROLLED BACK WHEN IMPORTING APP IN SQLPLUS
    When installing an application in SQL*Plus, the import fails with ORA-02091 if the application was exported in 4.1 or an older version and the application contains invalid references to shared components. Application Express raises this error on the final commit statement for invalid references from breadcrumb region to breadcrumb, list region to list or button to button template.
    Workaround: Install the application in Application Builder or fix the broken references in the old version before exporting again.
  • 21464648 - REFRESH THEME DELETES DISPLAY POINTS IN PAGE AND REGION TEMPLATES
    Using the 'Refreshing Theme' functionality deletes the Display Points configuration of all Page and Region Templates. This has the negative side effects in that Page Designer is not able to show friendly names for REGION_POSITION_xx display points anymore. When running the application the engine no longer knows if the region position supports a grid or not!
    Solution: There is a patchset exception for this available on My Oracle Support - search by bug number.
    Note: If you have already refreshed the theme after upgrading to Application Express 5.0.1, applying the patchset exception and refreshing the theme again will restore the display points.
  • 21463521 - IMAGES DIRECTORY NOT UP-TO-DATE WARNING AFTER APPLYING 5.0.1 PATCHSET
    After applying the Application Express 5.0.1 patchset, developers might receive the below alert when they try to login into the Application Builder although the images files from the patchset have been copied:
    There is a problem with your environment because the Application Express files are not up-to-date! The files for version 5.0.0.00.31 have been loaded, but 5.0.1.00.06 is expected. Please verify that you have copied the images directory to your application server as instructed in the Installation Guide.
    Workaround: Perform a ‘Force Refresh’ in your browser when viewing the Application Builder Login page or clear browser cache. See http://www.wikihow.com/Force-Refresh-in-Your-Internet-Browser
  • 21445226 - COLUMN CSS CLASSES NOT AVAILABLE IN TRANSLATED VERSION
    If CSS classes are specified for the Grid Layout “Column CSS Classes” attribute of Regions, Items or Buttons then those classes will only be used for the primary application language, but will not be present for any translated language.
    Solution: There is a patchset exception for this available on My Oracle Support - search by bug number.
  • 21441233 - DB APP SSO INTERNAL ERROR IF APP HAS CLEANUP PL/SQL CODE
    Database applications which use SSO authentication and have a non-empty Cleanup PL/SQL code block run into an internal error when processing the wwv_flow_custom_auth_sso.process_success callback.
    Solution: There is a patchset exception for this available on My Oracle Support - search by bug number.
  • 21434612 - WEBSHEET SSO ERROR: ERROR PROCESSING AUTHENTICATION
    Websheets which use SSO authentication run into an error processing the authentication when processing the wwv_flow_custom_auth_sso.process_success callback.
    Solution: There is a patchset exception for this available on My Oracle Support - search by bug number21441233.
  • 21435234 - PLUG-INS: REGION COLUMNS NOT FOUND FOR TRANSLATED APPS
    Regions of type “Column Toggle Report”, “Reflow Report” or custom Plug-ins using the “Region Columns” feature will fail with "ORA-00936: missing expression” when running a translated version of an application.
    Solution: There is a patchset exception for this available on My Oracle Support - search by bug number.
  • 21410037 - HTTP_ERROR_STATUS_ON_ERROR_PAGE_ENABLED IS IGNORED
    The instance parameter HTTP_ERROR_STATUS_ON_ERROR_PAGE_ENABLED is ignored for non-internal errors. (See also "Configuring Unhandled Errors" -https://docs.oracle.com/cd/E59726_01/doc.50/e39151/adm_wrkspc002.htm#BABJHHJI)
    Solution: There is a patchset exception for this available on My Oracle Support - search by bug number.
  • 21266549 - APEX_JSON.PARSE/TO_XMLTYPE RETURNING ORA-06502
    APEX_JSON can parse very large JSON objects, but the maximum length of any string member value is limited to 32767 bytes (i.e. the maximum size of a varchar2). Attempts to parse JSON with longer string member values will result in ORA-06502 Character string buffer too small.
    Workaround: There is no workaround currently available.
  • 11061801 - ORA-00604, ORA-06502 and ORA-06512 errors during index creation.
    If Oracle Workspace Manager is in use in the Oracle Database where you attempt to install Application Express, the installation of indexes may fail.
    Solution: Apply Database Patch 11061801 prior to attempting the upgrade. Search for 11061801 on the Patches tab at support.oracle.com to download the patch.
    Workaround: If you have not installed the patch, then you can workaorund the bug by adding spaces after the table name and each comma.
    For example, change
    create index wwv_flow_preferences$_fkidx on wwv_flow_preferences$(security_group_id,user_id,preference_name)
    to the following statement
    create index wwv_flow_preferences$_fkidx on wwv_flow_preferences$ (security_group_id, user_id, preference_name).
  • 20143941 - Interactive Report Fixed Headings not supported where report renders a complex table
    With Application Express 5.0, Interactive Reports now provide the capability to define fixed column headings, such that the header remains in a fixed in position when the user is scrolling down the report. When a ‘Control Break’ or a ‘Pivot’ is applied, the headings will no longer be fixed.
    Workaround: There is no workaround currently available.
  • 20806980 - Interactive Report Column Filter fails when column value is a link
    If an Interactive Report has a column value that is a link (where the link markup is constructed in the report query) , attempting to define a filter on this value from the column header menu fails. The link may have been defined in the report query as opposed to using the declarative column link support , for example in the case where you want to conditionally render a link, based on some query logic. Note: In previous versions of Application Express, this would work in setting the filter , however this would also have the negative consequence that you would be taken to the link target when selecting the filter value in the column header menu.
    Workaround: To workaround this issue, we recommend the following change to your report:
    1. Add another column to your query, that selects the equivalent of the link text from the link, and define a column alias of 'my_link_display'. This will be the value used in the column header menu.
    2. Change the 'my_link' column to be of type 'Hidden Column'.
    3. In the 'my_link_display' column, set the column heading to be the same as the 'my_link' column and set 'HTML Expression' to be '#MY_LINK#'. Keep the default 'Escape Special Characters' as 'Yes'.
    4. Run the page, and as this is an Interactive Report, you may need to re-order the columns to have the new column in the same position as the old one, via the 'Actions > Select Columns' dialog. Then save this as the defualt report via 'Actions > Save Report > 'Save as Default Report Settings').
    5. Observe now that the link still renders fine in the report, and the column header menu will now render just the 'my_link_display' value, which sets the filter correctly. You will also not be taken to the link target, as was the case in previous version of APEX.
    Note: For this example, we assume the original column name including the link is 'my_link'.
  • 20798913 - Migration from Legacy to CSS Calendar is broken if custom display was used
    Legacy calendar has two type of displaying event title (column or custom) . When the custom type is used, there is no automatic migration of the customized display text.
    Workaround: Change the SQL statement so that the custom column becomes a column that can be mapped to the Display Column attribute. Alternatively, use the Additional Information attribute to add a custom tooltip.

Using Screen Reader Mode in Your Database Applications

Sessions in Oracle Application Express can now be identified as optimized for screen readers, both in the Oracle Application Express development environment, Websheet runtime and also within your own database applications. By default sessions are not flagged as running in screen reader mode. This section describes how you can provide users of your own database applications access to this mode and also how you can extend it.
Although this mode improves usability of Oracle Application Express with a screen reader, there may still be some areas where outstanding issues remain. For a full list of outstanding issues with workarounds where possible, please refer to "Accessibility in Oracle Application Express" and Oracle Application Express Release Notes.

Provisioning Screen Reader Mode

There are three ways you can provision this mode for use with your own database applications.
  1. Page template #SCREEN_READER_TOGGLE# substitution string - Add this substitution string to your page template and Oracle Application Express displays a link to the current page to turn on or off (toggle) the mode. So if you are in standard mode, this procedure generates a link to turn it on.
  2. There are also APIs that can be used to control this mode. You may want to use the APIs if you only want to render the toggle in one place and do not want to do this at page template level or if you want more control over the actual displayed link text. Please see the Oracle Application Express API Reference for more details on these APIs.
  3. Using f?p syntax REQUEST attribute to enable and disable Screen Reader mode. The general syntax for f?p is:
    f?p=application:page:session:request:...
    
    If the request is exactly SET_SESSION_SCREEN_READER_ON or SET_SESSION_SCREEN_READER_OFF then the session is put into or out of Screen Reader mode. For example:
    <a href="f?p=100:1:&SESSION.:SET_SESSION_SCREEN_READER_ON">Set Screen Reader On</a>
    

Extending Screen Reader Mode

In addition to what this mode does by default as detailed in "What Does Screen Reader Mode Do?", you can control your own page components. For example, you can conditionally display region when running in Screen Reader mode. Please see the Oracle Application Express API Reference for details of the relevant database functions, APEX_UTIL.IS_SCREEN_READER_SESSION and APEX_UTIL.IS_SCREEN_READER_SESSION_YN.

Load Progress waiting image after submitting page.

Load Progress waiting image after submitting page.

So basically we need to show some image till page completely loads.

Create one dynamic action:

Event: Click

-> Selection type: Item

-> Item: Button

->Action: Submit Page

->Settings -> Show Processing :YES

Create.

adf:dialog using popup in Oracle ADF by dialogListener

Handling OK and Cancel button in adf:dialog using popup in Oracle ADF by dialogListener

Requirement – We are displaying a popup message to user and on selecting on OK and CANCEl by user , writing custom code inside bean

Solution – You can have af:popup component in the page .Inside the popup , drag drop af:dialog component. You can call the pop up programmatic using my
another post of popup
For the dialog , you need to have some dialog listener. write it like
<af:dialog title="handling Ok and cancel event}"
           type="okCancel"
           dialogListener="#{techartifact.headerManage.dialogListener1}"
           id="d1">
The method of dialogListener1 can be written as below.Write inside a headerManage bean.
public void dialogListener1(DialogEvent dialogEvent)
  {
    if (dialogEvent.getOutcome() == DialogEvent.Outcome.ok)
    {
     // write your custom code for ok event
    } else
    {
      // write your custom code for cancel event
   }
  }

Show values in right side of shuttle

While working with select list and shuttle, when we want to display values into right side of shuttle depending upon selection from select ...