39.42. routine_routine_usage #

Представление routine_routine_usage идентифицирует все функции или процедуры, которые используются другой (или той же) функцией или процедурой, либо в теле SQL, либо в стандартных выражениях параметров. (Это представление поддерживается только для тел SQL без кавычек, но не для тел или функций на других языках.) Запись включается в представление только в том случае, если используемая функция принадлежит роли, активной в данный момент. (Это ограничение не распространяется на использующую функцию.)

Обратите внимание, что в записях этого представления для обеих подпрограмм задаётся однозначное имя подпрограммы, несмотря на то, что имена столбцов используются не так, как в других представлениях информационной схемы, посвящённых подпрограммам. Этого требует стандарт SQL, хотя по логике так не должно быть. За дополнительными сведениями об однозначных именах обратитесь к Разделу 39.45.

Таблица 39.40. Столбцы routine_routine_usage

Тип столбца

Описание

specific_catalog sql_identifier

Имя базы данных, содержащей задействовавшую её функцию (всегда текущая база)

specific_schema sql_identifier

Имя схемы, содержащей задействовавшую её функцию

specific_name sql_identifier

«Однозначное имя» задействовавшей функции.

routine_catalog sql_identifier

Имя базы данных, содержащей функцию, задействованную в первой функции (всегда текущая база)

routine_schema sql_identifier

Имя схемы, содержащей функцию, задействованную в первой функции

routine_name sql_identifier

«Однозначное имя» функции, задействованной в первой функции.


39.42. routine_routine_usage #

The view routine_routine_usage identifies all functions or procedures that are used by another (or the same) function or procedure, either in the SQL body or in parameter default expressions. (This only works for unquoted SQL bodies, not quoted bodies or functions in other languages.) An entry is included here only if the used function is owned by a currently enabled role. (There is no such restriction on the using function.)

Note that the entries for both functions in the view refer to the specific name of the routine, even though the column names are used in a way that is inconsistent with other information schema views about routines. This is per SQL standard, although it is arguably a misdesign. See Section 39.45 for more information about specific names.

Table 39.40. routine_routine_usage Columns

Column Type

Description

specific_catalog sql_identifier

Name of the database containing the using function (always the current database)

specific_schema sql_identifier

Name of the schema containing the using function

specific_name sql_identifier

The specific name of the using function.

routine_catalog sql_identifier

Name of the database that contains the function that is used by the first function (always the current database)

routine_schema sql_identifier

Name of the schema that contains the function that is used by the first function

routine_name sql_identifier

The specific name of the function that is used by the first function.


FAQ