I am using the custom authentication in Oracle Apex and after the user login, I need to change the parsing schema we assigned to the user.
How can I do that?
❇️ OrclQA.Com is a question and answer forum for programmers.
❇️ Here anyone can ask questions and anyone can answer to help others.
❇️ It hardly takes a minute to sign up and it is 100% FREE.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
OrclQA.Com is a question and answer forum for programmers.
Here anyone can ask questions and anyone can answer to help others.
It hardly takes a minute to sign up and it is 100% FREE.
Vinish Kapoor
You can change the parsing schema using the apex_util.set_parsing_schema_for_request procedure from within the application's initialization code. Follow these steps:
Click on the Shared Components > Security Attributes > Database Session.
Then add the following PL/SQL code in the Initialization PL/SQL code section:
Change the table and column name according to your table.
Below is the screenshot for reference:
Hubert
Hi Vinish,
Would like to further extend the functionality by providing a facility to automate the creation of a schema and assign it to the workspace.
Please assume that for this scenario, there is a table with customer name and schema name.
The requirement is to have a separate form with one item and one button
Customer name (text field)
Create Schema (button)
On clicking the button, the system will create a schema (name would be a random generated text of 10 chars) and insert the customer name and the schema name in the customer table.
PL/SQL code is required for execution on click on button.
Please let me know if any further clarifications are required.
Is this possible?
Regards
Hubert
Vinish Kapoor
We can create the schema at runtime if the user has the related privilege. But I am not sure about assigning to the current workspace. Maybe you can try to logout after creating the schema so that the user can log in again and then it will be assigned as per the above procedure. Below is an example PL/SQL code:
amrit
Hi Vinish,
I am trying to parse schema while login. it give me error
"workspace has no privileges to parse as schema gnps22" kindly guide me how to resolve it.
Thanks
Vinish Kapoor
You need to grant connect privilege to the user you are using for the Oracle Apex application. For example, your default parsing schema is AMRIT then grant as follows:
amrit
Now it works,
Thanks
pavlos
How to add it in custom authentication?
Vinish Kapoor
Have you tried the same for custom authentication?
For custom authentication, you must be using a DB procedure. Try to include the above code in it. But I am not sure.
pavlos
It works I used:
BEGIN
apex_util.set_parsing_schema_for_request (
p_schema => :CURRENT_SCHEMA);
END;
:CURRENT_SCHEMA - An application item that has a value selected by the user on the login page.
pavlos
I forgot to mention, I tried it on demo which use apex authentication. But, for me it looks like that it will work on custom authentication.