 |
|
Oracle Database Tips by Donald Burleson |
APEX's HTMLDB_CUSTOM_AUTH
application_page_item_exists(
p_page_item in varchar2 )
return boolean;
Sometimes there may be a stored procedure or
PL/SQL, such as an application level process, that works for several
application pages. This function gives the ability to check for the
existence of a page item.
Example:
begin
if htmldb_custom_auth.application_page_item_exists(
'P100_CUSTOMER_ID' ) then
-- Do something.
end;
get_session_id return number;
This returns the users session id. It can be used
within stored procedures. For example, if audit records are being
inserted in the database, this function can be used to get the session
id.
Example:
declare
n_sid number;
begin
n_sid := htmldb_custom_auth.get_session_id;
end;
get_username return varchar2;
This returns the authenticated username. If the
application page is public, the return value will be NOBODY.
Example:
declare
s_username varchar2(255);
begin
s_username := htmldb_custom_auth.get_username(
get_username );
end;
login(
p_uname in varchar2,
p_password in varchar2,
p_session_id in varchar2,
p_app_page in varchar2,
p_entry_point in varchar2,
p_preserve_case in boolean);
This procedure performs authentication and session
registration. It is commonly referred to as the Login API.
Parameters:
-
p_uname: User's Login name.
-
password: Password in clear text.
-
p_session_id: Session ID of the current session.
-
p_app_page: Application ID and page ID of where
to navigate to after login. Format APP_ID:APP_PAGE_ID (colon
delimited).
-
p_entry_point: Used internal by APEX only.
-
p_preserve_case: If TRUE, do not change case of
p_uname to uppercase.
Example:
begin
-- Only use V( ) when referencing APP_SESSION
login( 'MCUNNING', 'easybook',
V('APP_SESSION'), :APP_ID || ':1' );
The above book excerpt is from:
Easy HTML-DB
Oracle Application Express
Create
Dynamic Web Pages with OAE
ISBN 0-9761573-1-4
Michael Cunningham & Kent Crotty
http://www.rampant-books.com/book_2005_2_html_db.htm |