Get User Privileges

5949
11
Jump to solution
05-29-2015 08:41 AM
CliveSwan
Occasional Contributor II

I am trying to:

1) Determine which tables to select to get the User Privileges

2) Run an arcpy script to get all FeatureClass, Table priviliges

I get an ORA-00936 error (933 ORA-00933: SQL command not properly ended)

The SQL statement is:

sql_statement =

"SELECT OWNER,OBJECT_TYPE,OBJECT_NAME  \

    FROM DBA*  \

    WHERE OWNER = 'GISADMIN' and OBJECT_TYPE = 'TABLE'"

The SQL appears to be correct???

Don't understand why it is returning this error??

Thanks,

Clive

0 Kudos
11 Replies
BillDaigle
Occasional Contributor III

I agree with Blake about the triple quoted strings.  They are much cleaner and will allow you to copy and paste from a SQL editor like PLSQL or SQL Developer.

sql_statement =  """
                   SELECT *
                   FROM USER_TAB_PRIVS
                   WHERE OWNER LIKE 'GISADMN'
                 """
BlakeTerhune
MVP Regular Contributor

When you have WHERE OWNER LIKE 'GISADMN' without a % wildcard, you're essentially just saying equals. For the sake of clarity, you should change it to WHERE OWNER = 'GISADMN' unless you really do want a wildcard at the beginning or end.