5 Other Functions
5-12
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
5-2-8 Relationship with the DB Connection Instructions
This section describes the operations of DB Connection Instructions to be performed when one
or more SQL statements are already stored in the Spool memory and the impacts to the spooling
operations to be performed when an Instruction Execution Timeout occurred for a DB
Connection Instruction.
Executing DB Connection Instructions when SQL Statements are Already Stored
in the Spool Memory
This section describes the operation to be performed when each DB Connection Instruction is
executed for a DB Connection that already has one or more SQL statements in the Spool
memory.
The SQL statement (INSERT) is spooled.*
The instruction ends in an error. (Error = TRUE, SendStatus = _DBC_SEND_SPOOLED)
Refer to Appendix DB Connection Instructions for ErrorID of the instruction execution error.
The SQL statement (UPDATE) is spooled.*
The instruction ends in an error. (Error = TRUE, SendStatus = _DBC_SEND_SPOOLED)
Refer to Appendix DB Connection Instructions for ErrorID of the instruction execution error.
The SQL statement (SELECT) is not sent to the DB.
An instruction execution error occurs. (Error = TRUE)
Refer to Appendix DB Connection Instructions for ErrorID of the instruction execution error.
The SQL statement (DELETE) is not sent to the DB.
An instruction execution error occurs. (Error = TRUE)
Refer to Appendix DB Connection Instructions for ErrorID of the instruction execution error.
* If the remaining Spool memory area is not enough when the SQL statement is spooled, the SQL
statements will be discarded without being stored in the Spool memory.
DB_Insert
(Insert DB
Record)
The SQL statement (INSERT) is not sent to the DB.
An instruction execution error occurs. (Error = TRUE
,
SendStatus=_DBC_SEND_SENDING
)
Refer to Appendix DB Connection Instructions for ErrorID of the instruction execution error.
DB_Update
(Update DB
Record)
The SQL statement (UPDATE) is not sent to the DB.
An instruction execution error occurs. (Error = TRUE
,
SendStatus=_DBC_SEND_SENDING
)
Refer to Appendix DB Connection Instructions for ErrorID of the instruction execution error.
Operations of Instructions and DB Connection Service in the Case of DB
Connection Instruction Execution Timeout
When a DB Connection Instruction Execution Timeout occurs, the transmitted SQL statement is
stored in the Spool memory. The DB Connection Service waits for a response from the DB for
the time set in the Query execution timeout parameter plus 10 seconds* after the DB Connection
Instruction is executed.
When a response is returned from the DB, the SQL statement stored in the Spool memory is
deleted. If no response has been returned from the DB when the time set in the Query execution
timeout parameter plus 10 seconds* has elapsed, the DB Connection is changed to the
Disconnected status.
If a DB_Insert (Insert DB Record), DB_Update (Update DB Record), DB_Select (Retrieve DB
Record), or DB_Delete (Delete DB Record) instruction is executed while the DB Connection
Service is waiting for a response from the DB, an error (DB in Process) occurs for the instruction.