Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

DevControl

  • Last UpdatedJul 17, 2025
  • 2 minute read

Controls a dBASE or SQL device. You can pack a dBASE device to physically remove deleted records, or re-index a dBASE device to regenerate the keys. You can issue queries to an SQL device, or get the error status of the last SQL query.

For SQL devices, this function is a blocking Cicode function.

NOTICE

SECURITY BREACH VIA SQL INJECTION

When using command type 2 with an SQL device, an SQL injection attack can occur if the query contains user input. To mitigate this:

  • Verify that any user inputs match the expected format for the associated data type.

  • Use stored procedures.

  • Use a limited access account to connect to the database.

Failure to follow these instructions can result in equipment damage.

Note: this function does not support parameterized SQL, instead use SQLConnect and other SQL Functions.

Syntax

DevControl(hDev, Type [, sData])

hDev:

The device handle, returned from the DevOpen function. The device handle identifies the table where all data on the associated device is stored.

nType:

The type of command:

0 - Re-index the device based on the key defined in the device record (dBASE devices only).

1 - Pack the database file - all deleted records are removed (dBASE devices only).

2 - Issue a direct SQL query to the device (SQL devices only).

3 - Get error status of the last SQL query (SQL devices only).

Note: ASCII files and printers are not supported.

sData:

The command data, that is the SQL query to be issued. Used only for Type 2 commands.

Return Value

0 (zero) if successful, otherwise an error code is returned.

DevOpen, DevZap

Example

! pack a dBASE file device
DevControl(hDev, 1, "");

See Also

Device Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in