How To Estimate The Number Of Sql Statements That Can Be Spooled - Omron NX701-1620 User Manual

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

Advertisement

5 Other Functions
5-2-9
How to Estimate the Number of SQL Statements that Can be
Spooled
The number of SQL statements that can be spooled depends on the user program.
This section describes how to estimate the number of SQL statements that can be spooled.
 Calculation of the Number of Bytes of each SQL Statement
You can calculate the number of bytes of each SQL statement as shown below.
You can check the contents of SQL statements with the Debug Log.
Refer to 6-3 Debug Log for the information on the Debug Log.
Instruction
DB_Insert
(Insert DB
Record)
DB_Update
(Update DB
Record)
*
Text strings of SQL statements are handled as UTF-8. One byte is used for each single-byte
alphanumeric character and multiple bytes are used for each multi-byte character. Three bytes are
used for each Japanese character as a guide.
 Calculation of the Number of SQL Statements that Can be Spooled
You can estimate the number of SQL statements that can be spooled using the following
formulae.
Number of SQL statements that can be spooled =
Spool capacity per DB Connection (bytes) ÷ Number of bytes of each SQL statement
Spool capacity per DB connection (bytes) =
Capacity of the entire Spool memory (2,097,152 bytes for NX701-@@20, 1,048,576 bytes for
NJ501-@@20, or 196,608 bytes for NJ101-@@20) ÷ Number of DB Connections for which the
Spool function is enabled
5-14
SQL statement
insert into <TableName>
(<ColumnName1>,
<ColumnName2>,
<ColumnName3>...,
<ColumnNameN>)
values(<Value1>, <Value2>,
<Value3>..., <ValueN>)
update <TableName> set
<ColumnName1>=<Value1>,
<ColumnName2>=<Value2>...,
<ColumnNameN>=<ValueN>
where <RetrievalCondition>
NJ/NX-series Database Connection CPU Units User's Manual (W527)
Calculating formula of the number of bytes of
each SQL statement*
50 + (Number of bytes of <TableName>)
+ (Number of bytes of <ColumnName1>)
+ (2 + Number of bytes of <ColumnName2>)
+ (2 + Number of bytes of <ColumnName3>)
... +( 2 + Number of bytes of <ColumnNameN>)
+ (Number of bytes of <Value1>)
+ (2 + Number of bytes of<Value2>)
+ (2 + Number of bytes of <Value3>)
... +(2+ Number of bytes of <ValueN>)
45 + (Number of bytes of <TableName>)
+ (3 + Number of bytes of <ColumnName1> +
Number of bytes of <Value1>)
+ (5 + Number of bytes of <ColumnName2> +
Number of bytes of <Value2>)
+ (5 + Number of bytes of <ColumnName3> +
Number of bytes of <Value3>)
... + (5 + Number of bytes of <ColumnNameN>
+ Number of bytes of <ValueN>)
+ (Number of bytes of <RetrievalCondition>)

Advertisement

Table of Contents

Troubleshooting

loading

Table of Contents