Main Content

Writing Data Common Errors

This table describes how to address common errors you might encounter while working with the sqlwrite function. These errors apply to all database vendors.

Error MessageProbable CausesResolution
columnname column value must be a numeric array or cell array of numeric scalars.

The specified data type of the database column is invalid.

Specify a valid data type for the database column. For valid data types, see the data input argument description in the sqlwrite function.

columnname column value must be a datetime array, cell array of character vectors, or string array.
columnname column value must be a logical array.
columnname column value must be a cell array of character vectors or string array.
JDBC/ODBC Error: errormessage

The JDBC or ODBC driver throws an error.

Consult your database driver documentation.

Unable to create tablename without column types. Specify 'ColumnType' for each variable in the table data.

You are creating an empty database table.

Specify the 'ColumnType' name-value pair argument and provide the data type for all columns in the database table. For details, see the sqlwrite function.

Specify 'ColumnType' for each variable in the table data.

You did not specify the data type of at least one column in the database table.

Specify the 'ColumnType' name-value pair argument and provide the data type for all columns in the database table. For details, see the sqlwrite function.