skip to main content
OpenAccess SDK SQL Engine Core Functions API : Function Reference : dam_getFirstPrivilege/dam_getFirstPrivilegeW
 

dam_getFirstPrivilege/dam_getFirstPrivilegeW

These functions are used to navigate the privilege list in the Grant and Revoke commands of the IP DCL function. Use dam_getFirstPrivilegeW for Unicode.
Refer to the "Privileges" section in the OpenAccess SDK SQL Engine Programmer's Guide for information on implementing this function.
int dam_getFirstPrivilege(
    DAM_HSTMT hstmt,
    int * piPrivId,
    char * pcCatalog,
    char * pcPrivRoleName);

int dam_getFirstPrivilegeW(
    DAM_HSTMT hstmt,
    int * piPrivId,
    OAWCHAR * pcCatalog,
    OAWCHAR * pcPrivRoleName);
Table 116. Parameters for dam_getFirstPrivilege/dam_getFirstPrivilegeW
Parameter
Type
Description
IN
hstmt
DAM_HSTMT
The statement handle.
OUT
piPrivId
int *
The type of the privilege:
*0 - indicates that the privilege is a Role.
*System Privilege
*Object Privilege
System Privileges:
SQL_SYS_PRIV_CREATE_ANY_INDEX
SQL_SYS_PRIV_ALTER_ANY_INDEX
SQL_SYS_PRIV_DROP_ANY_INDEX
SQL_SYS_PRIV_GRANT_ANY_PRIVILEGE
SQL_SYS_PRIV_CREATE_PROCEDURE
SQL_SYS_PRIV_CREATE_ANY_PROCEDURE
SQL_SYS_PRIV_DROP_ANY_PROCEDURE
SQL_SYS_PRIV_EXECUTE_ANY_PROCEDURE
SQL_SYS_PRIV_GRANT_ANY_ROLE
SQL_SYS_PRIV_CREATE_TABLE
SQL_SYS_PRIV_CREATE_ANY_TABLE
SQL_SYS_PRIV_ALTER_ANY_TABLE
SQL_SYS_PRIV_DROP_ANY_TABLE
SQL_SYS_PRIV_SELECT_ANY_TABLE
SQL_SYS_PRIV_INSERT_ANY_TABLE
SQL_SYS_PRIV_UPDATE_ANY_TABLE
SQL_SYS_PRIV_DELETE_ANY_TABLE
SQL_SYS_PRIV_CREATE_VIEW
SQL_SYS_PRIV_CREATE_ANY_VIEW
SQL_SYS_PRIV_DROP_ANY_VIEW
SQL_SYS_PRIV_CREATE_USER
SQL_SYS_PRIV_CREATE_ANY_USER
SQL_SYS_PRIV_DROP_ANY_USER
SQL_SYS_PRIV_CREATE_ROLE
piPrivId
int *
System Privileges:
SQL_SYS_PRIV_CREATE_ANY_USER
SQL_SYS_PRIV_DROP_ANY_USER
SQL_SYS_PRIV_CREATE_ROLE
SQL_SYS_PRIV_DROP_ROLE
Object Privileges:
SQL_OBJ_PRIV_ALTER
SQL_OBJ_PRIV_DELETE
SQL_OBJ_PRIV_EXECUTE
SQL_OBJ_PRIV_INDEX
SQL_OBJ_PRIV_INSERT
SQL_OBJ_PRIV_SELECT
SQL_OBJ_PRIV_UPDATE
SQL_OBJ_PRIV_AL
pcCatalog
OAWCHAR *
The name of the Catalog. Applicable if Privilege Id is returned as 0.
pcPrivRoleName
OAWCHAR *
The name of the role.
RETURN
int
DAM_SUCCESS - on success
DAM_FAILURE - on failure
DAM_NO_DATA_FOUND - on no data retrieved