Sign Up

❇️ 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.

Have an account? Sign In


Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now
Sign InSign Up

OrclQA.Com

OrclQA.Com Logo OrclQA.Com Logo

OrclQA.Com Navigation

  • Oracle
  • Oracle Apex
  • Python
  • Questions
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Ask Question
  • Add Post
  • Oracle
  • Oracle Apex
  • Python
  • Questions
OrclQA Wiki
OrclQA Wiki

OrclQA Wiki

  • 6 Questions
  • 1 Answer
  • 0 Best Answers
  • 58 Points
View Profile
  • 1
OrclQA WikiProfessional
Asked: October 4, 20202020-10-04T12:36:40+05:30 2020-10-04T12:36:40+05:30

How to change parsing schema in Oracle Apex?

  • 1

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?

oracle apexpasing schema
  • 10
  • 2k
  • 0
  • 0
  • Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
Answer

10 Answers

  1. Vinish Kapoor

    Vinish Kapoor

    • 1 Question
    • 727 Answers
    • 63 Best Answers
    • 4k Points
    View Profile
    Vinish Kapoor Enlightened
    2020-10-04T12:47:24+05:30Added an answer on October 4, 2020 at 12:47 pm

    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:

    Declare
       v_parsing_schema varchar2(30);
    Begin
       Select user_schema into v_parsing_schema
         from your_user_table
         where username = :APP_USER;
    
    apex_util.set_parsing_schema_for_request (
       p_schema => v_parsing_schema);
    End;

    Change the table and column name according to your table.

    Below is the screenshot for reference:

    Changing parsing schema in Oracle Apex.

    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
  2. Hubert

    Hubert

    • 0 Questions
    • 1 Answer
    • 0 Best Answers
    • 27 Points
    View Profile
    Hubert Contributor
    2021-02-04T16:11:47+05:30Added an answer on February 4, 2021 at 4:11 pm

    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

     

    • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
  3. Vinish Kapoor

    Vinish Kapoor

    • 1 Question
    • 727 Answers
    • 63 Best Answers
    • 4k Points
    View Profile
    Vinish Kapoor Enlightened
    2021-02-04T16:36:57+05:30Added an answer on February 4, 2021 at 4:36 pm

    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:

    Declare
      v_schema varchar2(10);
    Begin
      v_schema := dbms_random.string('v', 10);
      insert into customer values (:p2_customer, v_schema);
      execute immediate 'Grant connect, resource to '||v_schema 
           ||' identified by '||v_schema;
      apex_authentication.logout(:SESSION, :APP_ID);
    End;

     

    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
  4. amrit

    amrit

    • 5 Questions
    • 5 Answers
    • 0 Best Answers
    • 61 Points
    View Profile
    amrit Professional
    2021-03-16T17:21:49+05:30Added an answer on March 16, 2021 at 5:21 pm

    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

     

     

     

    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
    • Vinish Kapoor

      Vinish Kapoor

      • 1 Question
      • 727 Answers
      • 63 Best Answers
      • 4k Points
      View Profile
      Vinish Kapoor Enlightened
      2021-03-16T17:32:54+05:30Replied to answer on March 16, 2021 at 5:32 pm

      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:

      Grant dba to amrit;
      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
      • amrit

        amrit

        • 5 Questions
        • 5 Answers
        • 0 Best Answers
        • 61 Points
        View Profile
        amrit Professional
        2021-03-17T21:33:13+05:30Replied to answer on March 17, 2021 at 9:33 pm

        Now it works,

        Thanks

        • 0
        • Share
          Share
          • Share on Facebook
          • Share on Twitter
      • pavlos

        pavlos

        • 37 Questions
        • 107 Answers
        • 1 Best Answer
        • 376 Points
        View Profile
        pavlos Guru
        2021-05-12T15:37:50+05:30Replied to answer on May 12, 2021 at 3:37 pm
        This answer was edited.

        How to add it in custom authentication?

        • 1
        • Share
          Share
          • Share on Facebook
          • Share on Twitter
        • Vinish Kapoor

          Vinish Kapoor

          • 1 Question
          • 727 Answers
          • 63 Best Answers
          • 4k Points
          View Profile
          Vinish Kapoor Enlightened
          2021-05-13T06:43:04+05:30Replied to answer on May 13, 2021 at 6:43 am

          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.

          • 0
          • Share
            Share
            • Share on Facebook
            • Share on Twitter
          • pavlos

            pavlos

            • 37 Questions
            • 107 Answers
            • 1 Best Answer
            • 376 Points
            View Profile
            pavlos Guru
            2021-05-13T17:25:17+05:30Replied to answer on May 13, 2021 at 5:25 pm

            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.

            • 1
            • Share
              Share
              • Share on Facebook
              • Share on Twitter
          • pavlos

            pavlos

            • 37 Questions
            • 107 Answers
            • 1 Best Answer
            • 376 Points
            View Profile
            pavlos Guru
            2021-05-13T22:11:20+05:30Replied to answer on May 13, 2021 at 10:11 pm

            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.

            • 0
            • Share
              Share
              • Share on Facebook
              • Share on Twitter

You must login to add an answer.

Forgot Password?

Sidebar

Explore

  • Ask Question
  • Add Post

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
© 2022 OrclQA.Com. All Rights Reserved.
Privacy Policy - About Us