The API
package contains all information to interact with ora* CODECOP
. It is executable by all users and works with invokers rights.
This chapter contains the following topics:
Parameters and Constants in the API
package use these datatypes.
Name | Type |
---|---|
small_string |
A string containing max. 20 chars (not nullable). |
bool |
A not nullable natural number between 0 and 1. |
The API
package provides constants for rule objects, severities and characteristics.
These constants are described in the following table.
Name | Value |
---|---|
PLSQL_UNIT |
'PLSQL_UNIT' |
SQL_DATA_OBJECT |
'SQL_DATA_OBJECT' |
DATABASE_OBJECT |
'DATABASE_OBJECT' |
APEX |
'APEX' |
BLOCKER |
'BLOCKER' |
CRITICAL |
'CRITICAL' |
MAJOR |
'MAJOR' |
MINOR |
'MINOR' |
INFO |
'INFO' |
CHANGEABILITY |
'CHANGEABILITY' |
EFFICIENCY |
'EFFICIENCY' |
MAINTAINABILITY |
'MAINTAINABILITY' |
PORTABILITY |
'PORTABILITY' |
RELIABILITY |
'RELIABILITY' |
REUSABILITY |
'REUSABILITY' |
SECURITY |
'SECURITY' |
TESTABILITY |
'TESTABILITY' |
The following table lists exceptions that have been defined for API
.
Exception | Code | Description |
---|---|---|
e_rule_failed |
-20001 |
The rule failed because the specified SQL returned more than 0 rows. |
e_invalid_rule_id |
-20002 |
The given ID for the rule could not be found. |
e_invalid_code |
-20003 |
The given CODE for the rule could not be found. |
e_invalid_value |
-20004 |
The given VALUE for the rule_object, severity, characteristic or tag could not be found. |
This table lists the API
subprograms and briefly describes them.
Subprogram | Description |
---|---|
Execute the sql statement from RULE_ID or CODE in RULESET. |
|
Verify the rule according to the RULE_ID or CODE in RULESET. |
|
Same as procedure CHECK_RULE Procedure but can be used in SQL. |
|
Verify all rules that belongs to one of the associated dimension (rule_object, characteristic, severity), a tag or to all defined rules. |
|
Same as procedure CHECK_RULES Procedure but can be used in SQL. |
Execute the sql statement from RULE_ID or CODE in RULESET.
Parameters | Description |
---|---|
i_rule_id_or_code |
A valid RULE_ID or CODE from RULESET. If not valid exception e_invalid_rule_id or e_invalid_code is raised. |
Verify the rule according to the RULE_ID or CODE in RULESET.
procedure check_rule(
i_rule_id_or_code in string,
i_verbose_mode in boolean default true,
i_raise_if_fail in boolean default false);
Parameters | Description |
---|---|
i_rule_id_or_code |
A valid RULE_ID or CODE from RULESET. If not valid exception e_invalid_rule_id or e_invalid_code is raised. |
i_verbose_mode |
Adjust the amount of details. |
i_raise_if_fail |
Raise an exception if a rule is failed. |
Verify all or a specific rule according to the RULE_ID or CODE in RULESET.
function check_rule(
i_rule_id_or_code in string,
i_verbose_mode in bool default 1,
i_raise_if_fail in bool default 0)
return string_c;
Parameters | Description |
---|---|
i_rule_id_or_code |
A valid RULE_ID or CODE from RULESET. If not valid exception e_invalid_rule_id or e_invalid_code is raised. |
i_verbose_mode |
Adjust the amount of details. |
i_raise_if_fail |
Raise an exception if a rule is failed. |
Verify all rules that belongs to one of the associated dimension (rule_object, characteristic, severity), a tag or to all defined rules.
procedure check_rules(
i_value in string default null,
i_verbose_mode in boolean default true,
i_raise_if_fail in boolean default false);
Parameters | Description |
---|---|
i_value |
One of the following rule_objects, severities, characteristics: PLSQL_UNIT, SQL_DATA_OBJECT, DATABASE_OBJECT, INFO, MINOR, MAJOR, CRITICAL, BLOCKER, CHANGEABILITY, EFFICIENCY, MAINTAINABILITY, PORTABILITY, RELIABILITY, REUSABILITY', SECURITY, TESTABILITY or one of the defined TAGS (case insensitive). If a severity keyword is chosen, all severity levels greater or equal are used. If parameter is not valid exception e_invalid_value is raised. If parameter is NULL all available rules will verified. |
i_verbose_mode |
Adjust the amount of details. |
i_raise_if_fail |
Raise an exception if a rule is failed. |
Verify all rules that belongs to one of the associated dimension (rule_object, characteristic, severity), a tag or to all defined rules.
function check_rules(
i_value in string default null,
i_verbose_mode in bool default 1,
i_raise_if_fail in bool default 0)
return string_c;
Parameters | Description |
---|---|
i_value |
One of the following rule_objects, severities, characteristics: PLSQL_UNIT, SQL_DATA_OBJECT, DATABASE_OBJECT, INFO, MINOR, MAJOR, CRITICAL, BLOCKER, CHANGEABILITY, EFFICIENCY, MAINTAINABILITY, PORTABILITY, RELIABILITY, REUSABILITY', SECURITY, TESTABILITY or one of the defined TAGS (case insensitive). If a severity keyword is chosen, all severity levels greater or equal are used. If parameter is not valid exception e_invalid_value is raised. If parameter is NULL all available rules will verified. |
i_verbose_mode |
Adjust the amount of details. |
i_raise_if_fail |
Raise an exception if a rule is failed. |