Md. Quium Hossain who I'm Oracle DBA & APEX Developer. All-rounder in building small, medium, and enterprise applications. Extensive knowledge in various areas of web-driven applications in Back-end (PL/SQL, SQL, Java), Front-end (Oracle APEX, Oracle Forms, Oracle Reports, HTML, JavaScript, CSS, jQuery, OracleJET, ReactJS), RESTful APIs, Third-party library integrations (Apex Office Print (AOP), Payment Gateways, SMS, Syncfusion, HighCharts) and APEX Plugins (HighChart, StarRating)
Sunday, April 28, 2019
Saturday, April 27, 2019
set default home page of different user privileges in oracle apex 18.2 or all
1. Create table
Create table namely TUSER for holding the user data
CREATE TABLE tuser(
Id NUMBER PRIMARY KEY,
Uname VARCHAR2(24) UNIQUE,
Pwd VARCHAR2(128),
Status VARCHAR2(12)
);
2. Create application item -->> GLOBAL_STATUS_ITEM
3. Custom Authentication Schemes
a. Go to Shared Components/Authentication Schemes then Create
b. Create New Custom Authentication Scheme
* name : my_user_auth * Authentication Function Name: my_user_auth
FUNCTION my_user_auth
(p_username IN VARCHAR2, p_password IN VARCHAR2) RETURN BOOLEAN
AS
Result NUMBER :=0;
Sts VARCHAR2(12);
BEGIN
SELECT 1, status INTO Result, Sts
FROM tuser
WHERE UPPER(uname)=UPPER(p_username)
AND pwd = p_password;
IF Result =1 THEN
APEX_UTIL.SET_SESSION_STATE('GLOBAL_STATUS_ITEM', Sts);
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN FALSE;
END my_user_auth;
4. Create three page blank page with blank region
admin
manager
staff
5. Create branch
Edit Page 1 (Home)
a. Create Branches
b. name : Branch To Function Returning Page
DECLARE
Psts VARCHAR2(64);
Result VARCHAR2(8);
BEGIN
Psts := APEX_UTIL.GET_SESSION_STATE('GLOBAL_STATUS_ITEM');
IF Psts='ADMIN' THEN Result:= '2';
ELSIF Psts='MANAGER' THEN Result:= '3';
ELSE Result:= '4';
END IF;
RETURN Result;
END;
6. check it login
Create table namely TUSER for holding the user data
CREATE TABLE tuser(
Id NUMBER PRIMARY KEY,
Uname VARCHAR2(24) UNIQUE,
Pwd VARCHAR2(128),
Status VARCHAR2(12)
);
2. Create application item -->> GLOBAL_STATUS_ITEM
3. Custom Authentication Schemes
a. Go to Shared Components/Authentication Schemes then Create
b. Create New Custom Authentication Scheme
* name : my_user_auth * Authentication Function Name: my_user_auth
FUNCTION my_user_auth
(p_username IN VARCHAR2, p_password IN VARCHAR2) RETURN BOOLEAN
AS
Result NUMBER :=0;
Sts VARCHAR2(12);
BEGIN
SELECT 1, status INTO Result, Sts
FROM tuser
WHERE UPPER(uname)=UPPER(p_username)
AND pwd = p_password;
IF Result =1 THEN
APEX_UTIL.SET_SESSION_STATE('GLOBAL_STATUS_ITEM', Sts);
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN FALSE;
END my_user_auth;
4. Create three page blank page with blank region
admin
manager
staff
5. Create branch
Edit Page 1 (Home)
a. Create Branches
b. name : Branch To Function Returning Page
DECLARE
Psts VARCHAR2(64);
Result VARCHAR2(8);
BEGIN
Psts := APEX_UTIL.GET_SESSION_STATE('GLOBAL_STATUS_ITEM');
IF Psts='ADMIN' THEN Result:= '2';
ELSIF Psts='MANAGER' THEN Result:= '3';
ELSE Result:= '4';
END IF;
RETURN Result;
END;
6. check it login
Tuesday, April 23, 2019
two way catch app user name in oracle apex
1 &APP_USER. for Static Value 2. :APP_USER for PL/SQL Expression
Thursday, April 18, 2019
sql query href link in oracle apex
select
a.MENU_CODE
, a.MENU_NAME as "CARD_TITLE"
, dbms_lob.getlength(IMG) as "CARD_TEXT"
,'<a href="f?p=' ||APPP_ID||':'||PAGGE_ID||':'||:APP_SESSION|| '">"Go to Apps"</a>' as "CARD_SUBTEXT"
from strerp_user_menu_info a, strerp_user_menu_detail b
where a.MENU_CODE=b.MENU_CODE
and b.EMP_ID=:APP_USER
and b.END_DT is null
and b.STATUS='E'
order by MENU_CODE
a.MENU_CODE
, a.MENU_NAME as "CARD_TITLE"
, dbms_lob.getlength(IMG) as "CARD_TEXT"
,'<a href="f?p=' ||APPP_ID||':'||PAGGE_ID||':'||:APP_SESSION|| '">"Go to Apps"</a>' as "CARD_SUBTEXT"
from strerp_user_menu_info a, strerp_user_menu_detail b
where a.MENU_CODE=b.MENU_CODE
and b.EMP_ID=:APP_USER
and b.END_DT is null
and b.STATUS='E'
order by MENU_CODE
Wednesday, April 3, 2019
Monday, April 1, 2019
How to insert image manually in oracle apex 18.2 all
Step 1
CREATE TABLE "MYIMAGES_TBL"
( "ID" NUMBER NOT NULL ENABLE,
"IMAGE_NAME" VARCHAR2(400),
"FILENAME" VARCHAR2(350),
"MIME_TYPE" VARCHAR2(255),
"DOC_SIZE" NUMBER,
"CHARSET" VARCHAR2(128),
"LAST_UPDATE_DATE" DATE,
"CONTENT" BLOB,
CONSTRAINT "MYIMAGES_TBL_PK" PRIMARY KEY ("ID")
USING INDEX ENABLE
)
/
CREATE OR REPLACE EDITIONABLE TRIGGER "BI_MYIMAGES_TBL"
before insert on "MYIMAGES_TBL"
for each row
begin
if :NEW."ID" is null then
select "MYIMAGES_TBL_SEQ".nextval into :NEW."ID" from sys.dual;
end if;
end;
/
ALTER TRIGGER "BI_MYIMAGES_TBL" ENABLE
/
CREATE SEQUENCE MYIMAGES_TBL_SEQ
MINVALUE 1
MAXVALUE 999999999999999999999999999
START WITH 1
INCREMENT BY 1
CACHE 20;
Step 2
create blank page
& item P13_FILENAME text ,
P13_MIME_TYPE text,
P13_CONTENT file browse
--This page after submit plsql code
declare
doc_size integer;
Upload_blob blob;
begin
--Copy BLOB to Upload_blob variable
select blob_content
into Upload_blob
from APEX_APPLICATION_TEMP_FILES
where name = :P75_FILE_BROWSER;
--Get BLOB size
doc_size := dbms_lob.getlength(Upload_blob);
--Copy data to table MyIMAGES_TBL
if doc_size <= 1000000 then
insert into MyIMAGES_TBL (
IMAGE_NAME, FILENAME,
MIME_TYPE, DOC_SIZE,
CONTENT )
select :FILE_NAME, filename,
mime_type, doc_size,
blob_content
from APEX_APPLICATION_TEMP_FILES
where name = :P75_FILE_BROWSER;
--Delete temp files
delete from APEX_APPLICATION_TEMP_FILES where name = :P75_FILE_BROWSER;
else
delete from APEX_APPLICATION_TEMP_FILES where name = :P75_FILE_BROWSER;
commit;
raise_application_error(-20001,'Cannot upload pictures bigger than 1MB!');
end if;
exception
when others then
raise_application_error(-20001,'Error when uploading image!');
end;
Step 3
Run
CREATE TABLE "MYIMAGES_TBL"
( "ID" NUMBER NOT NULL ENABLE,
"IMAGE_NAME" VARCHAR2(400),
"FILENAME" VARCHAR2(350),
"MIME_TYPE" VARCHAR2(255),
"DOC_SIZE" NUMBER,
"CHARSET" VARCHAR2(128),
"LAST_UPDATE_DATE" DATE,
"CONTENT" BLOB,
CONSTRAINT "MYIMAGES_TBL_PK" PRIMARY KEY ("ID")
USING INDEX ENABLE
)
/
CREATE OR REPLACE EDITIONABLE TRIGGER "BI_MYIMAGES_TBL"
before insert on "MYIMAGES_TBL"
for each row
begin
if :NEW."ID" is null then
select "MYIMAGES_TBL_SEQ".nextval into :NEW."ID" from sys.dual;
end if;
end;
/
ALTER TRIGGER "BI_MYIMAGES_TBL" ENABLE
/
CREATE SEQUENCE MYIMAGES_TBL_SEQ
MINVALUE 1
MAXVALUE 999999999999999999999999999
START WITH 1
INCREMENT BY 1
CACHE 20;
Step 2
create blank page
& item P13_FILENAME text ,
P13_MIME_TYPE text,
P13_CONTENT file browse
--This page after submit plsql code
declare
doc_size integer;
Upload_blob blob;
begin
--Copy BLOB to Upload_blob variable
select blob_content
into Upload_blob
from APEX_APPLICATION_TEMP_FILES
where name = :P75_FILE_BROWSER;
--Get BLOB size
doc_size := dbms_lob.getlength(Upload_blob);
--Copy data to table MyIMAGES_TBL
if doc_size <= 1000000 then
insert into MyIMAGES_TBL (
IMAGE_NAME, FILENAME,
MIME_TYPE, DOC_SIZE,
CONTENT )
select :FILE_NAME, filename,
mime_type, doc_size,
blob_content
from APEX_APPLICATION_TEMP_FILES
where name = :P75_FILE_BROWSER;
--Delete temp files
delete from APEX_APPLICATION_TEMP_FILES where name = :P75_FILE_BROWSER;
else
delete from APEX_APPLICATION_TEMP_FILES where name = :P75_FILE_BROWSER;
commit;
raise_application_error(-20001,'Cannot upload pictures bigger than 1MB!');
end if;
exception
when others then
raise_application_error(-20001,'Error when uploading image!');
end;
Step 3
Run
Subscribe to:
Posts (Atom)
How to install and configure Oracle Apex 24.1 with ORDS 22, Tomcat 9 and Jasper Report 7 on Oracle Linux 8.10
#########################Install Oracle APEX 24.1################################ ----------------------------------------------------...
-
# Report Column (only column): 1. Column Formatting > HTML Expression <span style="display:block; width: 200px"> #...
-
Installing Oracle Forms and Reports 12c on Windows 10 64 Bit. Hardware used for this installation is · Intel i3-2370M CPU · ...
-
when open forms builder then errors FRM-91129: fatal error: no value specified for required environment variable FORMS_BUILDER_CLASSPATH a...
-
---------------------------- | Keyboard Shortcut | ---------------------------- · Create: Breadcrumb Region Ctrl+/, C, B · ...