NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
P-22
POSITION Function
An invalid plan is a plan considered invalid by SQL because changes made after the
plan was compiled might have made the plan inoperable or not optimal. A plan is
invalid, for example, if an object referenced in the plan was redefined after the plan was
last compiled.
A plan can also be invalid for a specific program startup—but not generally invalid—if
the startup-time value of a DEFINE referenced in the plan is different from the value of
that DEFINE at the time the plan was compiled.
An invalid plan can also be an operable plan if the set of tables for which the plan was
compiled is similar to the set of tables associated with the plan at execution time. See
Similarity Checks
on page S-55 for details about the differences permitted between such
tables.
An altered plan is an invalid but operable plan that the SQL compiler has updated to use
a different set of tables without actually recompiling the plan itself.
For more information about plans, see the NonStop SQL/MP Query Guide.
POSITION Function
The POSITION function searches for a given substring in a character string. If the
substring is found, SQL returns the character position of the substring within the string.
substring
specifies the string substring to search for in character-string.
character-string
specifies the source string.
POSITION (substring IN character-string[,occurrence])
where substring and character-string are:
{ string-literal }
{ column-name }
{ param-name }
{ host-var-name }
{ UPSHIFT function }
{ character-expression }
and occurrence is:
{ numeric-literal }
{ column-name }
{ param-name }
{ host-var-name }
{ expression }