Monday, May 05, 2014

ORA-01700 and/or ORA-01711

I tested these on Oracle 11.2. You can grant a privilege like this:

SQL> grant create table to andrew
  2  /
 
Grant succeeded.

SQL>

... but if you try to grant a privilege more than once in the same grant statement, you get an ORA-01711:

SQL> grant create table,
  2  select any table,
  3  create table to andrew
  4  /
create table to andrew
*
ERROR at line 3:
ORA-01711: duplicate privilege listed

SQL>

... and if you try to grant a privilege to the same user more than once in the same grant statement, you get an ORA-01700:

SQL> grant create table to
  2  andrew, fred, andrew
  3  /
andrew, fred, andrew
              *
ERROR at line 2:
ORA-01700: duplicate username in list
 
SQL>

No comments:

Post a Comment