ALLBASE/SQL Reference Manual (36216-90216)

582 Chapter12
SQL Statements S - Z
UPDATE
column. If the rule has no condition, it will fire for all rows affected by the statement
and invoke its associated procedure with the specified parameters on each row. If the
rule has a condition, it will evaluate the condition on each row. The rule will fire on rows
for which the condition evaluates to TRUE and invoke the associated procedure with
the specified parameters for each row. Invoking the procedure could cause other rules,
and thus other procedures, to be invoked if statements within the procedure trigger
other rules.
If a DISABLE RULES statement is issued, the UPDATE statement will not fire any
otherwise applicable rules. When a subsequent ENABLE RULES is issued, applicable
rules will fire again, but only for subsequent UPDATE statements, not for those rows
processed when rule firing was disabled.
In a rule defined with a
StatementType
of UPDATE, any column reference in the
Condition
or any
ParameterValue
that specifies the
OldCorrelationName
will
refer to the value of the column before the SET clause assignment is performed on it.
Any column reference that specifies the
NewCorrelationName
or
TableName
will
refer to the value of the column after the SET clause assignment is performed on it.
The set of rows to be affected by the UPDATE statement is determined before any rule
fires, and this set remains fixed until the completion of the rule. If the rule adds to,
deletes from, or modifies this set, such changes are ignored.
When a rule is fired by this statement, the rule's procedure is invoked after the changes
have been made to the database for that row and all previous rows. The rule's
procedure, and any chained rules, will thus see the state of the database with the
current partial execution of the statement.
If an error occurs during processing of any rule considered during execution of this
statement (including execution of any procedure invoked due to a rule firing), the
statement and any procedures invoked by any rules will have no effect. Nothing will
have been altered in the DBEnvironment as a result of this statement or the rules it
fired. Error messages are returned in the normal way.
SQL Syntax — LongColumnIOString
{ [<{[
PathName
/]
FileName
%SharedMemoryAddress
}]
[{>
>>
>!}[
PathName
/]{
FileName
CharString$
CharString$ CharString
}
>% {
SharedMemoryAddress
$ } ] } |...|
Parameters — LongColumnIOString
< [
PathName
/]
FileName
is the location of the input file.
<%
SharedMemoryAddress
is the shared memory address where the input is located.
> specifies that output is placed in the following file. If the file already exists,
it is not overwritten nor appended to, and an error is generated.