Omron NX701-1620 User Manual page 229

Machine automation controller nj/nx-series database connection cpu units
Hide thumbs Also See for NX701-1620:
Table of Contents

Advertisement

Function
This instruction is used to delete the records that match the conditions specified in the Where input variable from
the table specified in the TableName input variable.
The records to delete are retrieved according to the retrieval conditions specified in the Where input variable
(WHERE clause). The Where input variable is expressed as a text string.
The text string in the Where input variable cannot consist of Null characters (16#00) only. In that case, the
instruction is terminated due to an error.
When using single quotes in the WHERE clause, use the escape character ($').
Refer to the NJ/NX-series CPU Unit Software User's Manual (Cat. No. W501) for the escape character.
Refer to the manual of the database for the format of the WHERE clause.
Specify the retrieval conditions in the Where input variable by the following values.
Example:
Delete the records where either of the values of the specified two columns is equal to the specified
value.
Delete the records where the value of "ColumnA" (unsigned integer) is equal to 1000 or the value of
"ColumnB" (unsigned integer) is equal to 2000
'"ColumnA" = 1000 OR "ColumnB" = 2000'
SQL statement to create: DELETE FROM TableProduct Where "ColumnA" = 1000 OR "ColumnB" = 2000
Precautions for Correct Use
 Execution of this instruction is continued until processing is completed even if the value of Execute changes to
FALSE or the execution time exceeds the task period. The value of Done changes to TRUE when processing
is completed. Use this to confirm normal completion of processing.
 Refer to Using this Section of the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for a timing
chart for Execute, Done, Busy, and Error.
 This instruction cannot be used on an event task. A compiling error will occur.
 This instruction cannot be executed without specifying the retrieval conditions.
 When the DB Connection Service was started in Test Mode, this instruction is normally ended without
executing the DELETE operation for the DB actually.
 When the error code is 300B hex (SQL Execution Error), you can get the detailed information of the SQL
Execution Error by executing a DB_GetConnectionStatus instruction.
 The measurement error of timeout is +50 ms for a 100-column record when the percentage of task execution
time is 50% as a guide. However, the measurement error varies according to the percentage of task execution
time and the number of columns.
 When two or more DB Connection Instructions are executed for a DB Connection at the same time, the DB
Connection Service executes the instructions one by one. The measurement of timeout for the second and
later instructions is started when the instruction is executed by the DB Connection Service, not when the
Execute input variable is changed to TRUE. Therefore, the time from when the Execute input variable is
changed to TRUE to when the timeout occurs for the instruction is longer than the time set for the timeout.
 An error occurs for this instruction in the following cases. Error will be TRUE.
 When the instruction was executed when the DB Connection Service was not running
 When the instruction was executed while the initialization processing of the DB Connection Service
was in progress
 When the instruction was executed while the DB Connection Service was stopped due to an error
NJ/NX-series Database Connection CPU Units User's Manual (W527)
Appendix A
A
A-41

Advertisement

Table of Contents

Troubleshooting

loading

Table of Contents