Skip to main content

GET_PREFS

The GET_PREFS function is used to retrieve the default value of a specified preference.

Syntax

DBMS_STATS.GET_PREFS (
pname IN VARCHAR2,
ownname IN VARCHAR2 DEFAULT NULL,
tabname IN VARCHAR2 DEFAULT NULL)
RETURN VARCHAR2;

Parameters

ParameterDescription
pnameThe name of the preference.
ownnameThe username. If ownname is set to NULL, the current login username is used by default.
tabnameThe table name.

Exceptions

Error CodeDescription
HY000
  • The resource manager is not enabled, and statistics cannot be collected simultaneously.
  • Invalid input value.

Examples

Retrieve the default value of the GRANULARITY parameter for user testUser01 in the tbl1 table.

SELECT DBMS_STATS.GET_PREFS ('GRANULARITY','testUser01','tbl1') FROM DUAL;
+----------------------------------------------------------+
| DBMS_STATS.GET_PREFS ('GRANULARITY','testUser01','tbl1') |
+----------------------------------------------------------+
| AUTO |
+----------------------------------------------------------+
1 row in set