# 22. Virtuoso Functions Guide - __any_grants

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
__any_grants
close
collation_define
complete_table_name
delay
end_result
exec
exec_next
exec_result
exec_result_names
identity_value
name_part
registry_get
registry_get_all
registry_name_is_pro...
registry_remove
registry_set
result
result_names
row_count
sequence_get_all
sequence_next
sequence_remove
sequence_set
set_identity_column
set_row_count
set_user_id
signal
sinv_create_inverse
sinv_create_key_mapp...
sinv_drop_inverse
sys_stat_analyze
sys_stat_histogram
table_drop_policy
table_set_policy
username
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## __any_grants

Checks a table for grants.
integer __any_grants (in tablename varchar);
Description

The __any_grants() can be used to test whether there are any rights granted (for insert/update/delete) to a table for current SQL account.

Parameters
tablename – The table name to be tested.
Return Types

An integer will be returned to indicate whether the table supplied has any privileges granted (1) or not granted (zero 0) for current SQL user.

Errors

SQLState | Error Code | Error Text | Description
--- | --- | --- | ---
22023 | SR014 | Function any_grants needs a string as argument 1, not an arg of type [type] |

Examples
Using the __any_grants() function

This simple example shows testing a grant rights for a table, using the __any_grants() function from ISQL and demo SQL user accout.

    $isql localhost:1112 demo demo
    -- the demo account owns an Orders table, so it's granted
    SQL> select __any_grants ('Demo.demo.Orders');
    callret
    INTEGER
    _______________________________________________________________________________

    1

    1 Rows. -- 1 msec.

    -- but it has no permission to access the table SYS_REPL_ACCOUNTS
    SQL> select __any_grants ('DB.DBA.SYS_REPL_ACCOUNTS');
    callret
    INTEGER
    _______________________________________________________________________________

    0

    1 Rows. -- 5 msec.