Search This Blog

Tuesday, May 21, 2019

Run Time Validation Or Validation From Dynamic Action By JavaScript in Oracle Apex

Run Time Validation Or Validation From Dynamic Action By JavaScript in Oracle Apex STEP-1: CREATE JS FUNCTION ON PAGE LEVEL JUST PASTE THE BELOW CODE function myerror(){ var myval = apex.item('P6_ERR').getValue();//document.getElementById('P6_ERR').value; apex.message.clearErrors(); apex.message.showErrors( [ { "type": "error", "location": "page", "message": myval }] ); } STEP-2: CALL THE FUNCTION ON ONCHANGE EVENT ON YOUR SPECIFIC ITEM ON CUSTOM ATTRIBUTE onchange="myerror();" STEP-3: CREATE A DYNAMIC ACTION ON CLICK OR AS YOU WISH PASTHE BELOW SAMPLE CODE EVENT: CLICK ACTION: EXECUTE PL/SQL CODE BEGIN IF LENGTH(:P6_NEW)>=10 THEN :P6_ERR :='Length must not exceed 10 digit....'; --RAISE_APPLICATION_ERROR(-20001,'Length must not exceed 4 digit....'); elsif LENGTH(:P6_NEW)>=5 THEN :P6_ERR :='Length must not exceed 4 digit....'; end if; exception when others then :P6_ERR :=SQLERRM; --RAISE_APPLICATION_ERROR(-20001,'Length must not exceed 4 digit'); END; STEP-1: CREATE JS FUNCTION ON PAGE LEVEL JUST PASTE THE BELOW CODE

function myerror(){
    var myval = apex.item('P6_ERR').getValue();//document.getElementById('P6_ERR').value;
    apex.message.clearErrors();
    apex.message.showErrors(
[
 {
  "type":     "error",
  "location": "page",
  "message": myval
}]
);
}

STEP-2: CALL THE FUNCTION ON ONCHANGE EVENT ON YOUR SPECIFIC ITEM ON CUSTOM ATTRIBUTE

onchange="myerror();"

STEP-3: CREATE A DYNAMIC ACTION ON CLICK OR AS YOU WISH PASTHE BELOW SAMPLE CODE
EVENT: CLICK
ACTION: EXECUTE PL/SQL CODE

BEGIN
IF LENGTH(:P6_NEW)>=10 THEN
:P6_ERR :='Length must not exceed 10 digit....';
--RAISE_APPLICATION_ERROR(-20001,'Length must not exceed 4 digit....');
elsif LENGTH(:P6_NEW)>=5 THEN
:P6_ERR :='Length must not exceed 4 digit....';
end if;
exception 
when others then
:P6_ERR :=SQLERRM;
--RAISE_APPLICATION_ERROR(-20001,'Length must not exceed 4 digit');
END;

Thursday, May 16, 2019

Work With apex_collection in Oracle Apex


Work With apex_collection in Oracle Apex 1. Create apex_collection : apex_collection.create_collection('NAME'); 2. Existence Check: apex_collection.collection_exists ('NAME'); 3. Add Member: apex_collection.add_member (p_collection_name => 'NAME', p_c001 => :P2_ITEM1, p_c002 => :P2_ITEM2, p_c003 => :P2_ITEM3); 4. Collection to Database table data transcfer: BEGIN FOR i IN ( SELECT c001 AS a, c002 AS b, c003 AS c FROM apex_collections WHERE collection_name = 'NAME' ORDER BY 1) LOOP INSERT INTO DATABASE_TABLE (COLUMN1, COLUMN2, COLUMN3) VALUES (i.a, i.b, i.c); END LOOP; COMMIT; END; 5. Truncate Collection: apex_collection.truncate_collection(p_collection_name => 'NAME'); 6. Delete Collection Member : apex_collection.delete_member( p_collection_name => collection name, p_seq => member sequence number); 7. Delete All Collecion Members: apex_collection.delete_members( p_collection_name => collection name, p_attr_number => number of attribute used to match for the specified attribute value for deletion, p_attr_value => attribute value of the member attribute used to match for deletion); 8. Delete Collection : apex_collection.delete_collection ( p_collection_name =>'NAME'); 1. Create apex_collection :
(Collection Name Must be in Capital letter)
apex_collection.create_collection('NAME');

2. Existence Check:

apex_collection.collection_exists ('NAME');

3. Add Member:

  apex_collection.add_member (p_collection_name   => 'NAME',
                                  p_c001              => :P2_ITEM1,
                                  p_c002              => :P2_ITEM2,
                                  p_c003              => :P2_ITEM3);
                               
4. Collection to Database table data transcfer:

BEGIN
   FOR i IN (  SELECT c001 AS a, c002 AS b, c003 AS c
                 FROM apex_collections
                WHERE collection_name = 'NAME'
             ORDER BY 1)
   LOOP
      INSERT INTO DATABASE_TABLE (COLUMN1, COLUMN2, COLUMN3)
           VALUES (i.a, i.b, i.c);
   END LOOP;

   COMMIT;
END; 

5. Truncate Collection:

apex_collection.truncate_collection(p_collection_name => 'NAME');   

6. Delete Collection Member :

apex_collection.delete_member(
    p_collection_name => collection name,
    p_seq             => member sequence number);    
 
7. Delete All Collecion Members:

apex_collection.delete_members(
    p_collection_name => collection name,
    p_attr_number     => number of attribute used to match for the                           specified
                         attribute value for deletion, 
    p_attr_value      => attribute value of the member attribute                             used to match for deletion); 
8. Delete Collection :

apex_collection.delete_collection (
    p_collection_name =>'NAME');                                           

Friday, May 10, 2019

Re Assign Oracle Table Column Without Delete Data From Table Using (Rebuild form TOAD)

Re Assign Oracle Table Column Without Delete Data From Table Using (Rebuild form TOAD) ***Table ->altermode->Rebuild-> Script-> Re Assign Column -> Finally Execute.*** -- ********************************************************************** -- Note: This rebuild script is not meant to be used when a possibility * -- exists that someone might try to access the table while it is * -- being rebuilt! If you need online table rebuilding and you * -- are on Oracle 10g or newer, use the dbms_redfinition wizard * -- under database -> optimize. (Requires DB Admin module) * -- * -- Locks are released when the first DDL, COMMIT or ROLLBACK is * -- performed, so adding a "Lock table" command at the top of this * -- script will not prevent others from accessing the table for * -- the duration of the script. * -- * -- One more important note: * -- This script will cause the catalog in replicated environments * -- to become out of sync. * -- ********************************************************************** -- Table Rebuild script generated by Toad -- -- Original table: TEST1 -- Backup of table: TEST1_X -- Date: 11/05/2019 12:48:57 ***Table ->altermode->Rebuild-> Script-> Re Assign Column -> Finally  Execute.***

--  **********************************************************************
--  Note: This rebuild script is not meant to be used when a possibility *
--        exists that someone might try to access the table while it is  *
--        being rebuilt!  If you need online table rebuilding and you    *
--        are on Oracle 10g or newer, use the dbms_redfinition wizard    *
--        under database -> optimize. (Requires DB Admin module)         *
--                                                                       *
--        Locks are released when the first DDL, COMMIT or ROLLBACK is   *
--        performed, so adding a "Lock table" command at the top of this *
--        script will not prevent others from accessing the table for    *
--        the duration of the script.                                    *
--                                                                       *
--   One more important note:                                            *
--        This script will cause the catalog in replicated environments  *
--        to become out of sync.                                         *
--  **********************************************************************

--  Table Rebuild script generated by Toad
--
--  Original table: TEST1
--  Backup of table: TEST1_X
--  Date: 11/05/2019 12:48:57

Saturday, May 4, 2019

String Moving

Region Type Static Content

String Moving

<font style="font-size: 20px;" color=#009688><marquee> Moving String tag !!! :)</marquee></font>
<title>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPt8gG2nt9X3ciohb-CVI7lguVfUNIgfjTJKFbsRFNjlGHezxjpRn71k3dhb2dNuHgYJWB7_89NPqxD2Zi39L5IeMRGY8VQqg96uhEx98bV8nlAshq0Ks_SMjlUKwuwxE3bhc6vvvL-QU/s1600/movingtag.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="244" data-original-width="1340" height="115" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPt8gG2nt9X3ciohb-CVI7lguVfUNIgfjTJKFbsRFNjlGHezxjpRn71k3dhb2dNuHgYJWB7_89NPqxD2Zi39L5IeMRGY8VQqg96uhEx98bV8nlAshq0Ks_SMjlUKwuwxE3bhc6vvvL-QU/s640/movingtag.gif" width="640" /></a></div>
<br />
<u>Region Type Static Content </u><br />
<br />
<font style="font-size: 20px;" color=#009688><marquee> Moving String tag !!! :)</marquee></font>
Region Type Static Content String Moving <font style="font-size: 20px;" color=#009688><marquee> Moving String tag !!! :)</marquee></font> <title> <div class="separator" style="clear: both; text-align: center;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPt8gG2nt9X3ciohb-CVI7lguVfUNIgfjTJKFbsRFNjlGHezxjpRn71k3dhb2dNuHgYJWB7_89NPqxD2Zi39L5IeMRGY8VQqg96uhEx98bV8nlAshq0Ks_SMjlUKwuwxE3bhc6vvvL-QU/s1600/movingtag.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="244" data-original-width="1340" height="115" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPt8gG2nt9X3ciohb-CVI7lguVfUNIgfjTJKFbsRFNjlGHezxjpRn71k3dhb2dNuHgYJWB7_89NPqxD2Zi39L5IeMRGY8VQqg96uhEx98bV8nlAshq0Ks_SMjlUKwuwxE3bhc6vvvL-QU/s640/movingtag.gif" width="640" /></a></div> <br /> <u>Region Type Static Content </u><br /> <br /> <font style="font-size: 20px;" color=#009688><marquee> Moving String tag !!! :)</marquee></font>

How to open region as modal and pass a value from report or item.

1. Create report and take a column as link.
2. Create another region for modal and put a static ld like ‘m’
3. Then Link -> Target -> URL type and wright the code like this one.

Here  P1_ID is the item where you want to assign the value and #ID# is report value.
And  ‘m’ is the static id of modal region and this region template should be Inline Dialog .
javascript:$s('P1_ID','#ID#','#ID#'); javascript:openModal('m');

Monday, April 22, 2019

Report Button CSS

1. class="t-Button t-Button--hot"

2. class="add t-Button t-Button--warning t-Button--simple t-Button--stretch"

3. class="t-Button--small t-Button--simple t-Button--hot t-Button--stretch"

4. class="t-Button t-Button--hot t-Button--stretch"



class="t-Button t-Button--hot"

Sunday, April 21, 2019

Apex Report Header Image Size (CSS)

Apex Report Header Image Size (CSS) Catch Apex Report by Header Here imgid is static id of apex header. td[headers="imgid"] img{ width: 50px; height: 50px; } Catch Apex Report by Header

Here imgid is static id of apex header.

td[headers="imgid"] img{
    width: 50px;
    height: 50px;
}

Saturday, March 30, 2019

Bangla Writing in Oracle Database.

To Support Bangla Writing in Oracle Database. Please do the steps.

SQL> conn /as sysdba
Connected.
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP RESTRICT;
SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
System altered.
SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0;
System altered.
SQL> ALTER DATABASE CHARACTER SET AL32UTF8;
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP;

Thank You

Wednesday, March 20, 2019

For Single Application .. Multiple Schema


You Can Use API

--Shared Component
---Security Attribute
-----Database Session
-------Initialization PL/SQL Code

DECLARE

BEGIN
IF UPPER(:APP_USER) = 'A' THEN 

APEX_UTIL.SET_PARSING_SCHEMA_FOR_REQUEST 
( P_SCHEMA => 'HR_A');

ELSE 
APEX_UTIL.SET_PARSING_SCHEMA_FOR_REQUEST 
( P_SCHEMA => 'HR_B');
END IF; 

END;

Get Before @ Portion From a Email Address

SELECT SUBSTR( :EMAIL, 0, INSTR(:EMAIL,'@')-1) DY_USER_NAME
FROM DUAL ;

Create a Form Using Python for Save Data into Excel like a Database

#Download Pyhton from here https://www.python.org/downloads/  #Download Python: #Click the “Download Python 3.x.x” button (the latest versio...