Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

APEX 5.0.1 and APEX_UTIL.CREATE_USER

S-MaxJul 24 2015 — edited Jul 24 2015

Hi all,

I would like to create in my application a page, on which the admin users will be able to create new users.

For that purpose I have created a datasbase procedure with following content:

CREATE OR REPLACE PROCEDURE create_user (p_username IN VARCHAR2, p_password IN VARCHAR2,

                                         p_firstname IN VARCHAR2 DEFAULT NULL, p_lastname IN VARCHAR2 DEFAULT NULL,

                                         p_email IN VARCHAR2, p_desc IN VARCHAR2 DEFAULT NULL)

IS

BEGIN

  v_workspace_id := apex_util.find_security_group_id (p_workspace => 'MY_WORKSPACE');

  apex_util.set_security_group_id (p_security_group_id => v_workspace_id);

  

  APEX_UTIL.CREATE_USER(

      p_user_name           => p_username,

      p_first_name          => p_firstname,

      p_last_name           => p_lastname,

      p_description         => p_desc,

      p_email_address       => p_email,

      p_web_password        => p_password,

      p_web_password_format => 'CLEAR_TEXT'

  );


END create_user;

I also created an APEX page with an interactive report and the button to a modal page "Create or edit users". On the modal page I have a form with some fields and an after submit process with following code:

BEGIN

  create_user(

    p_user_name => :P1021_USERNAME,

    p_password  => :P1021_PASSWORD,

    p_firstname => :P1021_FIRSTNAME,

    p_lastname  => :P1021_LASTNAME,

    p_email     => :P1021_EMAIL,

    p_desc      => :P1021_DESC

  );

END;

If I will create the user from the APEX page then I get the error "Blocked API call, workspace modification via this application is prohibited" and ORA-20987.

If I execute the procedure from within SQL-Developer, it runs without problems.

What is wrong in my code?

Is there in APEX 5 any settings required for execute the APEX APIs from within APEX application?

Thanks!

This post has been answered by fac586 on Jul 24 2015
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 21 2015
Added on Jul 24 2015
2 comments
5,535 views