Muhammad Abdul Qaium is a Database Engineer/Oracle Apex Developer/BI Developer (in Atlanta, USA) who is an Oracle Certified Cloud Architect Professional, OCI Autonomous DB specialist as well as Oracle Business Intelligence Foundation Suite 11g Certified Implementation Specialist with extensive expertise in Database design , PL/SQL, Oracle Apex, Microsoft SSIS, ETL, Power BI, Qlik Sense, OBIEE. Contact: qaiuminfo@gmail.com
Search This Blog
Friday, December 29, 2023
Oracle Apex Workspace User Create, Edit Information, Reset Password
Monitor Oracle Database Job Scheduler Activity
SELECT * FROM DBA_SCHEDULER_RUNNING_JOBS ;
SELECT * FROM DBA_SCHEDULER_JOB_LOG WHERE LOG_DATE > SYSDATE - 1 ORDER BY LOG_DATE ;
SELECT * FROM DBA_SCHEDULER_JOB_RUN_DETAILS WHERE ACTUAL_START_DATE > SYSDATE - 1 order by ACTUAL_START_DATE ;
Thursday, November 30, 2023
Interactive Grid Top Scroll Bar in Oracle Apex
Step 1:
First, make a class name for the interactive grid.
Go to Page Properties >> Appearance >> CSS Classes >> CLASSNAME
Step 2:
Goto Page Properties >> CSS Inline >>
.CLASSNAME .a-GV-w-hdr{
overflow-x: auto !important;}
Monday, November 27, 2023
Apex User Creation from Process
BEGIN
apex_util.create_user (
p_user_name=> :NEW.USER_NAME,
p_first_name=> :NEW.FIRST_NAME,
p_last_name=> :NEW.LAST_NAME,
p_description=> :NEW.DESCRIPTION,
p_email_address =>:NEW.EMAIL_ADDRESS,
p_web_password=>:NEW.TEMP_PASSWORD,--p_group_ids=>set_group_id,
/*--For extra security, this resets the user's access to the APEX_BI schema only---*/
p_allow_access_to_schemas => 'STARS_DEMO',
/*--For extra security, this resets the user's default schema to APEX_BI--*/
p_default_schema => 'STARS_DEMO',
/*--For extra security, this resets the user's developer role to an end user Note: In FETCH USER and EDIT USER p_developer_privs is named p_developer_role ---*/
p_developer_privs => null,
p_account_locked => 'N',
p_failed_access_attempts =>0,
p_change_password_on_first_use=>'Y',
p_first_password_use_occurred =>'N');
/*--Email text defined --*/
An API call has been prohibited. Contact your administrator. Details about this incident are available via debug id "108075"
An API call has been prohibited. Contact your administrator. Details about this incident are available via debug id "108075"
Monday, November 20, 2023
Excel File Upload Without Using Plugins
STEP-1 Creating Collection and Taking Excel File Value into Collection Table
Begin
IF APEX_COLLECTION.COLLECTION_EXISTS('COLLECTION_TABLE_NAME') THEN
APEX_COLLECTION.TRUNCATE_COLLECTION('COLLECTION_TABLE_NAME');
END IF;
IF NOT APEX_COLLECTION.COLLECTION_EXISTS('COLLECTION_TABLE_NAME') THEN
APEX_COLLECTION.CREATE_COLLECTION('COLLECTION_TABLE_NAME');
END IF;
for r1 in (select * from apex_application_temp_files f, table( apex_data_parser.parse(
p_content => f.blob_content,
p_add_headers_row => 'Y',
-- p_store_profile_to_collection => 'FILE_PROV_CASH',
p_file_name=> f.filename,
p_skip_rows => 1 ) ) p
--This line will skip excel the first row, as I contain heading only
where f.name = :P3_UPLOAD_FILE -- //Page Item name
)
loop
APEX_COLLECTION.ADD_MEMBER(P_COLLECTION_NAME => 'COLLECTION_TABLE_NAME',
P_C001 => nvl(REPLACE(r1.col001,'-',''),0),
P_C002 => nvl(REPLACE(r1.col002,'-',''),0),
P_C003 => nvl(REPLACE(r1.col003,'-',''),0),
p_C004 => nvl(REPLACE(r1.col004,'-',''),0),
p_C005 => nvl(REPLACE(r1.col005,'-',''),0),
P_C006 => nvl(REPLACE(r1.col006,'-',''),0),
p_C007 => nvl(REPLACE(r1.col007,'-',''),0),
p_C008 => nvl(REPLACE(r1.col008,'-',''),0),
P_C009 => nvl(REPLACE(r1.col009,'-',''),0),
P_C010 => nvl(REPLACE(r1.col010,'-',''),0),
P_C011 => nvl(REPLACE(r1.col011,'-',''),0),
P_C012 => nvl(REPLACE(r1.col012,'-',''),0)
);
END LOOP;
end;
STEP-2 -- Transferring Collection Table to Database Table.
DECLARE
CURSOR C2 IS
SELECT C001, C002, C003, C004, C005, C006,
C007, C008, C009, C010, C011, C012 ,C013
FROM APEX_COLLECTIONS
WHERE
COLLECTION_NAME = 'COLLECTION_TABLE_NAME';
BEGIN
FOR I IN C2 LOOP
INSERT INTO DATABASE_TABLE
( COLUMN_NAME,
COLUMN_NAME,
COLUMN_NAME,
COLUMN_NAME,
COLUMN_NAME,
COLUMN_NAME,
COLUMN_NAME,
COLUMN_NAME,
COLUMN_NAME,
COLUMN_NAME,
COLUMN_NAME,
COLUMN_NAME,
COLUMN_NAME,
COLUMN_NAME
)
VALUES( I.C001,
I.C002, --collection data
I.C003,
I.C004,
I.C005,
I.C006,
I.C007,
I.C008,
I.C009,
I.C010,
I.C011,
I.C012,
I.C013,
:APP_USER
);
END LOOP;
--apex_collection.truncate_collection(p_collection_name => 'COLLECTION_TABLE_NAME');
END;
Monday, November 13, 2023
Multiple File Download into a ZIP File in Oracle Apex
Sunday, November 12, 2023
Column Freeze In Interactive Report Oracle Apex
Here we are freezing the first 5 columns from an interactive report in Oracle Apex.
Step-1. Copy the below code and pest into Page -> Execute when Page Loads
$('.a-IRR-table tr th:nth-child(2), .a-IRR-table tr td:nth-child(2)').css("left",$(".a-IRR-table tr th:nth-child(1)").width());
$('.a-IRR-table tr th:nth-child(3), .a-IRR-table tr td:nth-child(3)').css("left",$(".a-IRR-table tr th:nth-child(1)").width()+$(".a-IRR-table tr th:nth-child(2)").width());
$('.a-IRR-table tr th:nth-child(4), .a-IRR-table tr td:nth-child(4)').css("left",$(".a-IRR-table tr th:nth-child(1)").width()+$(".a-IRR-table tr th:nth-child(2)").width()+$(".a-IRR-table tr th:nth-child(3)").width());
$('.a-IRR-table tr th:nth-child(5), .a-IRR-table tr td:nth-child(5)').css("left",$(".a-IRR-table tr th:nth-child(1)").width()+$(".a-IRR-table tr th:nth-child(2)").width()+$(".a-IRR-table tr th:nth-child(4)").width());
Step-2 Copy the below code and pest into Page-> Inline
.a-IRR-table tr th:nth-child(1), .a-IRR-table tr td:nth-child(1)
{
position: sticky;
left: 0px !important;
}
.a-IRR-table tr th:nth-child(2), .a-IRR-table tr td:nth-child(2)
{
position: sticky;
}
.a-IRR-table tr th:nth-child(3), .a-IRR-table tr td:nth-child(3)
{
position: sticky;
}
.a-IRR-table tr th:nth-child(4), .a-IRR-table tr td:nth-child(4)
{
position: sticky;
left: 186px !important ;
}
.a-IRR-table tr th:nth-child(5), .a-IRR-table tr td:nth-child(5)
{
position: sticky;
left: 286px !important ;
}
Saturday, October 21, 2023
Standard Password Validation SQL Block
Standard Password Validation SQL Block
Standard Password Format Like
* One uppercase letter
* One lowercase letter
* One digit
* One special character
DECLARE
V_USERNAME VARCHAR2(100);
V_OLD_PASSWORD VARCHAR2(60);
PASSWORD VARCHAR2(60);
chars integer := 8;
letter integer := 1;
lower integer := 0;
upper integer := 1;
digit integer := 1;
special integer := 1;
digit_array varchar2(10) := '0123456789';
alpha_array varchar2(26) := 'abcdefghijklmnopqrstuvwxyz';
cnt_letter integer := 0;
cnt_upper integer := 0;
cnt_lower integer := 0;
cnt_digit integer := 0;
cnt_special integer := 0;
len integer := 0;
delimiter boolean := FALSE;
ch varchar2(100);
pw_lower varchar2(256);
BEGIN
V_USERNAME := :P9991_USER_NAME;
V_OLD_PASSWORD := :P9991_OLD_PASSWORD;
PASSWORD := :P9991_NEW_PASSWORD;
len := NVL (length(password), 0);
pw_lower := NLS_LOWER(password);
FOR i in 1..len LOOP
ch := substr(password, i, 1);
IF ch = '"' THEN
delimiter := TRUE;
ELSIF instr(digit_array, ch) > 0 THEN
cnt_digit := cnt_digit + 1;
ELSIF instr(alpha_array, NLS_LOWER(ch)) > 0 THEN
cnt_letter := cnt_letter + 1;
IF ch = NLS_LOWER(ch) THEN
cnt_lower := cnt_lower + 1;
ELSE
cnt_upper := cnt_upper + 1;
END IF;
ELSE
cnt_special := cnt_special + 1;
END IF;
END LOOP;
IF len>20 THEN
RETURN 'Password Must be less than 20 Characters';
ELSE
IF V_OLD_PASSWORD = PASSWORD THEN
RETURN 'New password cannot be same as old Password' ;
ELSE
IF delimiter = TRUE THEN
RETURN ('password must NOT contain a '|| 'double-quote character, which is '|| 'reserved as a password delimiter');
ELSE
IF chars IS NOT NULL AND len < chars THEN
RETURN( 'Password length less than ' ||chars);
ELSE
IF letter IS NOT NULL AND cnt_letter < letter THEN
RETURN( 'Password must contain at least ' ||letter || ' letter(s)');
ELSE
IF upper IS NOT NULL AND cnt_upper < upper THEN
RETURN('Password must contain at least ' ||upper || ' uppercase character(s)');
ELSE
IF lower IS NOT NULL AND cnt_lower < lower THEN
RETURN('Password must contain at least ' ||lower || ' lowercase character(s)');
ELSE
IF digit IS NOT NULL AND cnt_digit < digit THEN
RETURN('Password must contain at least ' ||digit || ' digit(s)');
ELSE
IF special IS NOT NULL AND cnt_special < special THEN
RETURN('Password must contain at least ' ||special || ' special character(s)');
ELSE
IF instr(pw_lower, NLS_LOWER(V_USERNAME)) > 0 THEN
RETURN('Password contains the username');
ELSE
RETURN NULL;
END IF;
END IF;
END IF;
END IF;
END IF;
END IF;
END IF;
END IF;
END IF;
END IF;
END;
Export Application Components Individually/All Together from a Oracle Apex Application
We Can Export Application Components individually from Oracle Apex.
Application > Shared Components > Export Application Components >
Under Component Select Type of Component > Selected/Check Component Name
like as 'Desktop Navigation Menu' > Add to Export > Next > Export Components.
Current version of data in database has changed since user initiated update process.
Current version of data in database has changed since user initiated update process.
Error occurred in Oracle Apex
This error can occur for many reasons, but one of the most common reasons is when the same row is updated by multiple parties at the same time.
In my case, I get the error when updating a flag in my table. Then I realized that when I update a flag a trigger gets fired and at the same row inside the trigger gets updated again. So I faced the problem.
Search by Keyword from All Oracle Database Objects
Search by keyword from Oracle Database Objects.
select owner, type, name, line, text
from dba_source where 1 = 1
and text like '%TEXT YOU ARE LOOKING FOR%'
order by owner, type, name;
Error - ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (BLOB File to CLOB Variable Conversion)
Read a BLOB File the message and display the message into a variable.
Error - ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 9923, maximum: 2000)
You can get around the buffer issue by reading the BLOB value in chunks. In order to do that, you can define a user defined function (UDF). The following UDF reads the BLOB field one chunk at a time, converts that to VARCHAR2 and appends the results consecutively to return the result as a CLOB:
RETURN CLOB IS
c CLOB;
n NUMBER;
BEGIN
IF (b IS NULL) THEN
RETURN NULL;
END IF;
IF (LENGTH(b) = 0) THEN
RETURN EMPTY_CLOB();
END IF;
DBMS_LOB.CREATETEMPORARY(c, TRUE);
n := 1;
WHILE (n + 32767 <= LENGTH(b)) LOOP
DBMS_LOB.WRITEAPPEND(c, 32767, UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(b, 32767, n)));
n := n + 32767;
END LOOP;
DBMS_LOB.WRITEAPPEND(c, LENGTH(b) - n + 1, UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(b, LENGTH(b) - n + 1, n)));
RETURN c;
END;
/
Monday, May 8, 2023
Thursday, April 20, 2023
Current version of data in database has changed since user initiated update process. Error occurred in Oracle Apex
Current version of data in database has changed since user initiated update process.
Error occurred in Oracle Apex
This error can occur for many reasons, but one of the most common reasons is when the same row is updated by multiple parties at the same time. In my case, I get the error when updating a flag in my table.
Then I realized that when I update the flag a trigger also fires and the same row inside the trigger gets updated again. So I faced a problem.
Monday, March 27, 2023
Negative Value Restriction in Oracle Apex Item
Goto Page Properties > Execute When Page Load > Copy-Pest Below Code with year page item.
$('#P51_NEW_2').autoNumeric('init',
{
allowDecimalPadding: false,
currencySymbol: "$",
decimalPlaces: 0,
roundingMethod: "D",
mDec: '0',
minimumValue: "0" -- (nagetive value not allowed)
});
Tuesday, March 14, 2023
How to develop Progress Bar in Oracle Apex (Bootstrap)
Bootstrap Progress Bar
1. --CSS INLINE .progress-bar { display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; -ms-flex-pack: center; justify-content: center; color: #fff; text-align: center; white-space: nowrap; background-color: #007bff; transition: width .6s ease; } .progress { display: -ms-flexbox; display: flex; height: 1rem; overflow: hidden; font-size: .75rem; background-color: #cfdae4; border-radius: .25rem; } -- COLUMN HTML EXPRESSION 2. <span> <div class="progress" style="height:20px;"> <div class="progress-bar" style="width:#Colum_Name#%">#Colum_Name#% </div> </div> </span> --COLUMN CALL BY FUNCTION 3. create or replace function progress_bar(p_value in number) return varchar2 IS l_height number:=20; begin return '<span> <div class="progress" style="height:'||l_height||'px;"> <div class="progress-bar" style="width:'||p_value||'%">'||p_value||'% </div> </div> </span>'; end ; -- CALL FUNCTION FROM REPORT QUERY 4. SELECT progress_bar(Colum_Name) FROM table;
Monday, February 20, 2023
Database Value with Comma , Number Sign in URL by Link Error Solution
*** Column link data includes commas, number sign error
*** Database Value with comma , number sign in URL by Link type report column
Solution :
Just make the column link value like this \#ColumnName#\ replace of #ColumnName#
Saturday, February 4, 2023
Store Data into Browser local storage and sessionStorage
Store Data into Browser local storage and sessionStorage.
1.setItem(key, value) – Add key and value to sessionStorage or localStorage.
localStorage.setItem("Order_id","12345");
or
sessionStorage.setItem("first_name","Vikas");
2. getItem(key) – This is how you get items from sessionStorage or localStorage.
localStorage.getItem("Order_id");
or
sessionStorage.getItem("first_name");
3.removeItem(key) – remove the key with its value from sessionStorage or localStorage.
localStorage.removeItem("Order_id");
or
sessionStorage.removeItem("first_name");
4. clear() – Clear all from sessionStorage or localStorage.
localStorage.clear();
or
sessionStorage.clear();
5. key(index) – Passed a number to retrieve the key of a sessionStorage or localStorage.
localStorage.key(0);
localStorage.key(1);
or
sessionStorage.key(0);
sessionStorage.key(1);
6. length – The number of stored items.
localStorage.length;
or
sessionStorage.length;
PDF to Text Covert by Oracle Apex
Here are the steps to convert and get the character into a region by Oracle Apex. Step1. Create a page and Copy-Pest the below code into Pa...
-
Search by keyword from Oracle Database Objects. select owner, type, name, line, text from dba_source where 1 = 1 and text like '%TEXT Y...
-
We Can Export Application Components individually from Oracle Apex. Application > Shared Components > Export Application Compo...