3 Programming the DB Connection Function
3-16
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Additional Information
When a DB_CreateMapping (Create DB Map) instruction is executed to create a mapping
for a DB Map Variable, it is not checked whether the structure members match the table’s
columns. In this case, the DB_Insert (Insert DB Record), DB_Update (Update DB Record),
or DB_Select (Retrieve DB Record) instruction will result in an error.
3-3-2 Registration and Attributes of DB Map Variables
You can specify the following variable types and attributes for DB Map Variables.
Registration of variables Global variable
Local variable for a program
Local variable for a function block
A local variable for a function
cannot be specified.
*1
Attributes Variable name Any Refer to the NJ/NX-Series CPU
Unit Software User’s Manual (Cat.
No. W501) for the restrictions on
the variable names and other
Data Type Structure data type for DB access Refer to 3-2 Creating a Structure
Constant Any This attribute cannot be specified
for SELECT.
A compiling error will occur for
DB_Select (Retrieve DB Record)
This attribute cannot be specified.
Array
specification
Array can be specified for SELECT. Array cannot be specified for
INSERT nor UPDATE. An
instruction error will occur for
DB_CreateMapping (Create DB
Map) instructions.
Refer to 3-3-3 Restrictions on DB
Map Variables for details.
*1 The DB Map Variables cannot be used in any function POU because the
DB_CreateMapping (Create DB Map) instruction is a function block type of instruction.