Skip to Main Content

Oracle Database Discussions

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!

SP2-0309: SQL*Plus command procedures may only be nested to a depth of 20

goodluck247Mar 7 2014 — edited Mar 7 2014

HELLO EVERYONE

HAVE THIS CODE:

clear screen

prompt ***********************************************

prompt *                                                                    *

prompt *                                                                    *

prompt *        CHOOSE ONE OF THE OPTIONS:         *

prompt *                                                                    *

prompt *          1. Create Role                                     *

prompt *          2. Grant Privilege to a Role                   *

prompt *          3. Create User                                     *

prompt *          4. Grant Role to a User                        *

prompt *                                                                    *

prompt *                                                                    *

prompt ***********************************************

accept choice prompt "Enter Choice: "

set term off

column virt_col new_value v_choice

select

   case '&choice'

   when '1' then 'C:\PLSQLII\mid_lab\script1.sql'

   when '2' then 'C:\PLSQLII\mid_lab\script2.sql'

   when '3' then 'C:\PLSQLII\mid_lab\script3.sql'

   when '4' then 'C:\PLSQLII\mid_lab\script4.sql'

   end

as virt_col

from dual;

set term on

@&v_choice

SO WHEN I ENTER 1 I CALL THIS CODE:

set verify off

set serveroutput on

clear screen

prompt ***********************************************

prompt *                                                         *

prompt *                                                         *

prompt *            CREATE ROLE                      *

prompt *                                                         *

prompt *                                                         *

prompt ***********************************************

accept role prompt "Enter role to be created:"

declare

   status number;

begin

   create_role('&role', status);

   if (status = 1) then

      dbms_output.put_line('This role already exists!');

   else

      dbms_output.put_line('Role created.');

   end if;

end;

prompt *********************************************************

accept choice prompt "Press any key to return to the main menu..."

@'C:\PLSQLII\mid_lab\menu.sql'

BUT WHEN I ENTER A NAME FOR A ROLE IT GIVES ME THIS ERROR:

SP2-0309: SQL*Plus command procedures may only be nested to a depth of 20.......

COULD YOU PLEASE HELP?

THANKS!

This post has been answered by Hoek on Mar 7 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2014
Added on Mar 7 2014
11 comments
3,642 views