Contents Index EXPERIENCE_ESTIMATE function [Miscellaneous] EXPRTYPE function [Miscellaneous]

ASA SQL Reference
  SQL Functions
    Alphabetical list of functions

EXPLANATION function [Miscellaneous]


Function 

Returns the short plan optimization strategy of a SQL statement, as a string.

Syntax 

EXPLANATION (
string-expression  [ cursor-type ],
update-status ]  )

Parameters 

string-expression    The SQL statement, which is commonly a SELECT statement but which may also be an UPDATE or DELETE.

cursor-type     A string. Cursor-type can be asensitive (default), insensitive, sensitive, or keyset-driven.

update-status    A string parameter accepting one of the following values indicating how the optimizer should treat the given cursor:

Value Description
READ-ONLY The cursor is read-only.
READ-WRITE (default) The cursor can be read or written to.
FOR UPDATE The cursor can be read or written to. This is exactly the same as READ-WRITE.
Standards and compatibility 
See also 

PLAN function [Miscellaneous]

GRAPHICAL_PLAN function [Miscellaneous]

GRAPHICAL_ULPLAN function [Miscellaneous]

LONG_ULPLAN function [Miscellaneous]

SHORT_ULPLAN function [Miscellaneous]

Example 

The following statement passes a SELECT statement as a string parameter and returns the plan for executing the query.

SELECT EXPLANATION(
   'SELECT * FROM department WHERE dept_id > 100' )

This information can help you decide which indexes to add or how to structure your database for better performance.

The following statement returns a string containing the short form of the textual plan for an INSENSITIVE cursor over the query 'select * from department where ....'.

SELECT EXPLANATION(
   'SELECT * FROM department WHERE dept_id > 100',
   'insensitive',
   'read-only' )

In Interactive SQL, you can view the plan for any SQL statement on the Plan tab in the Results pane.


Contents Index EXPERIENCE_ESTIMATE function [Miscellaneous] EXPRTYPE function [Miscellaneous]