13.7.2.7 pyqGrant Function (Autonomous AI Database)

This topic describes the pyqGrant function when used in Oracle Autonomous AI Database.

The pyqGrant function grants read privilege access to an OML4Py datastore or to a script in the OML4Py script repository.

Syntax

pyqGrant (
    V_NAME          VARCHAR2    IN
    V_TYPE          VARCHAR2    IN
    V_USER          VARCHAR2    IN     DEFAULT)

Parameters

Parameter Description
V_NAME The name of an OML4Py datastore or a script in the OML4Py script repository.
V_TYPE For a datastore, the type is datastore; for script the type is pyqScript.
V_USER The name of the user to whom to grant access.

Example 13-31 Granting Read Access to a script

-- Grant read privilege access to Scott.
BEGIN
  pyqGrant('pyqFun1', 'pyqscript', 'SCOTT');
END;
/

Example 13-32 Granting Read Access to a datastore

-- Grant read privilege access to datastore ds1 to SCOTT.
BEGIN
  pyqGrant('ds1', 'datastore', 'SCOTT');
END;
/

Example 13-33 Granting Read Access to a Script to all Users

-- Grant read privilege access to script RandomRedDots to all users.
BEGIN
  pyqGrant('pyqFun1', 'pyqscript', NULL);
END;
/

Example 13-34 Granting Read Access to a datastore to all Users

-- Grant read privilege access to datastore ds1 to all users.
BEGIN
  pyqGrant('ds1', 'datastore', NULL);
END;
/