snippetMinor
How to get Page Name given Page ID in Oracle Application Express
Viewed 0 times
expressapplicationgetnamepagehoworaclegiven
Problem
Prefix: I have looked all over the net for this answer. Let me prefix the question by describing what I am trying to do: I am trying to create a unique list of shortcuts to pages in my application for each user. So I am wanting to use a dynamic list to query for shortcut list. I already have procedures in place and ready to get the user ID and the page ID. I am using apex 5.0
The Question: What is the table and column (if it even exists) I need to query for in order to get the page name if given the corresponding page ID. ie:
Alternate Question: Is there an apex global variable like :APEX_USER or :APEX_PAGE_ID that I can use to get the page name/title.
The Question: What is the table and column (if it even exists) I need to query for in order to get the page name if given the corresponding page ID. ie:
select UNKNOWN_COLUMN_FOR_APEX_PAGE_NAME
from UNKNOWN_TABLE_FOR_APEX_PAGE_INFOAlternate Question: Is there an apex global variable like :APEX_USER or :APEX_PAGE_ID that I can use to get the page name/title.
Solution
Everything you want (and a lot more) is available in the view
And a sample query would be
There is a built-in substitution string APP_PAGE_ID and APP_ID, so you could do this in your page to use the current page ID and application ID to get the page title:
See https://docs.oracle.com/cd/E59726_01/doc.50/e39147/concept_sub.htm#BEIIBAJD for all the built-in substitution strings.
APEX_050000.APEX_APPLICATION_PAGESSYS@mydb01> describe apex_050000.APEX_APPLICATION_PAGES
Name Null? Type
--------------------------- -------- -------------------------------------
WORKSPACE NOT NULL VARCHAR2(255)
WORKSPACE_DISPLAY_NAME VARCHAR2(4000)
APPLICATION_ID NOT NULL NUMBER
APPLICATION_NAME NOT NULL VARCHAR2(255)
PAGE_ID NOT NULL NUMBER
PAGE_NAME NOT NULL VARCHAR2(255)
PAGE_TITLE VARCHAR2(255)
PAGE_MODE VARCHAR2(16)
...
PAGE_ALIAS VARCHAR2(255)And a sample query would be
select WORKSPACE, APPLICATION_NAME,
PAGE_ID, PAGE_NAME, PAGE_TITLE, PAGE_MODE
from APEX_050000.APEX_APPLICATION_PAGES
where workspace = 'MY_WS' and page_id=210;There is a built-in substitution string APP_PAGE_ID and APP_ID, so you could do this in your page to use the current page ID and application ID to get the page title:
select PAGE_TITLE from APEX_050000.APEX_APPLICATION_PAGES
where PAGE_ID = :APP_PAGE_ID and APPLICATION_ID = :APP_ID;See https://docs.oracle.com/cd/E59726_01/doc.50/e39147/concept_sub.htm#BEIIBAJD for all the built-in substitution strings.
Code Snippets
SYS@mydb01> describe apex_050000.APEX_APPLICATION_PAGES
Name Null? Type
--------------------------- -------- -------------------------------------
WORKSPACE NOT NULL VARCHAR2(255)
WORKSPACE_DISPLAY_NAME VARCHAR2(4000)
APPLICATION_ID NOT NULL NUMBER
APPLICATION_NAME NOT NULL VARCHAR2(255)
PAGE_ID NOT NULL NUMBER
PAGE_NAME NOT NULL VARCHAR2(255)
PAGE_TITLE VARCHAR2(255)
PAGE_MODE VARCHAR2(16)
...
PAGE_ALIAS VARCHAR2(255)select WORKSPACE, APPLICATION_NAME,
PAGE_ID, PAGE_NAME, PAGE_TITLE, PAGE_MODE
from APEX_050000.APEX_APPLICATION_PAGES
where workspace = 'MY_WS' and page_id=210;select PAGE_TITLE from APEX_050000.APEX_APPLICATION_PAGES
where PAGE_ID = :APP_PAGE_ID and APPLICATION_ID = :APP_ID;Context
StackExchange Database Administrators Q#147518, answer score: 2
Revisions (0)
No revisions yet.