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.

See also:

SYSTEM$REFERENCE

Syntax

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

Arguments

Required

select_statement

The SELECT statement to pass to the stored procedure. This must be a statement that serves as an inline view.

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

Optional

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

Returns

A query reference that represents the specified SELECT statement.

Usage Notes

Examples

See Using Query References.