mysql-native v1.2.0

API Reference Home: [This Version] [Latest Version] [Other Versions]


Function exec

Execute a one-off SQL command, such as INSERT/UPDATE/CREATE/etc.

ulong exec (
  Connection conn,
  string sql
);

This method is intended for commands such as which do not produce a result set (otherwise, use one of the query functions instead.) If the SQL command does produces a result set (such as SELECT), MYXResultRecieved will be thrown.

Use this method when you are not going to be using the same command repeatedly and you are CERTAIN all the data you're sending is properly escaped. Otherwise consider using Prepared.

Type Mappings

See the MySQL/D Type Mappings tables

Parameters

NameDescription
conn An open Connection to the database.
sql The SQL command to be run.

Returns

The number of rows affected.