background image
<< YEAR function | SYSCS_UTIL.SYSCS_GET_USER_ACCESS system function >>

Built-in system functions

<< YEAR function | SYSCS_UTIL.SYSCS_GET_USER_ACCESS system function >>
Derby Reference Manual
151
Built-in system functions
This section describes the different built-in system functions available with Derby.
SYSCS_UTIL.SYSCS_CHECK_TABLE system function
The
SYSCS_UTIL.SYSCS_CHECK_TABLE
function checks the specified table, ensuring
that all of its indexes are consistent with the base table. If the table and indexes are
consistent, the method returns a SMALLINT with value 1. If the table and indexes are
inconsistent, the function will throw an exception.
Syntax
SMALLINT SYSCS_UTIL.SYSCS_CHECK_TABLE(IN SCHEMANAME VARCHAR(128),
IN TABLENAME VARCHAR(128))
An error will occur if either SCHEMANAME or TABLENAME are null.
Execute privileges
If authentication and SQL authorization are both enabled, only the
database owner
has
execute privileges on this function by default. See "Enabling user authentication" and
"Setting the SQL standard authorization mode" in the Derby Developer's Guide for more
information. The database owner can grant access to other users.
Examples
Check a single table:
VALUES SYSCS_UTIL.SYSCS_CHECK_TABLE('SALES', 'ORDERS');
Check all tables:
SELECT schemaname, tablename,
SYSCS_UTIL.SYSCS_CHECK_TABLE(schemaname, tablename)
FROM sys.sysschemas s, sys.systables t
WHERE s.schemaid = t.schemaid;
SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY system function
The
SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY
function fetches the value of the
specified property of the database on the current connection.
If the value that was set for the property is invalid, the
SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY
function returns the invalid value, but
Derby uses the default value.
Syntax
VARCHAR(32672) SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY(IN KEY
VARCHAR(128))
An error will be returned if KEY is null.
Execute privileges
If authentication and SQL authorization are both enabled, only the
database owner
has
execute privileges on this function by default. See "Enabling user authentication" and
"Setting the SQL standard authorization mode" in the Derby Developer's Guide for more
information. The database owner can grant access to other users.
SQL example
Retrieve the value of the
derby.locks.deadlockTimeout
property: