Categories:

System functions (Information)

SYSTEM$QUERY_REFERENCE

Returns a query reference that you can pass to a stored procedure. Within the stored procedure, when you execute the query, the query is performed using the role of the user who created the query reference.

Note

As an alternative to calling this function, you can use the TABLE keyword, if you want the reference to be valid for the scope of the call (rather than for the entire session). See Using the TABLE keyword to create a reference to a table, view, or query.

See also:

SYSTEM$REFERENCE

语法

SYSTEM$QUERY_REFERENCE('<select_statement>', [ , <use_session_scope> ] )

实参

必填

select_statement

要传递给存储过程的 SELECT 语句。这必须是用作内联视图的语句。

Note that if the SELECT statement contains any single quotes or other special characters (e.g. newlines), you must escape those characters with backslashes.

可选

use_session_scope

If TRUE, specifies that the query reference should be valid for the duration for the session. If this is FALSE or omitted, the query reference is valid within the context in which it was created. See Specifying the scope of the reference.

Default value: FALSE

返回

一个表示指定的 SELECT 语句的查询引用。

使用说明

示例

See Using query references.