User`s guide
fastinsert
7-137
colnames = {'InvoiceNumber';'InvoiceDate';'productNumber';'Paid'};
tablename = 'invoice';
fastinsert(conn,tablename,colnames,data)
View the new record in the database to verify that the Paid field is Boolean. In some
databases, the MATLAB logical value 0 shows as a Boolean false, No, or a cleared check
box.
curs = exec(conn,'select * from invoice');
curs = fetch(curs);
curs.Data
ans =
...
[61178] '2012-01-15 00:00...' [ 9] [0] [2378330x1 int8]
[62145] '2012-01-23 00:00...' [10] [1] [ 492314x1 int8]
[ 2101] '2014-10-23 11:14...' [11] [1] []
The last row contains the Boolean data 1.
Close the database connection.
close(conn)
Input Arguments
conn — Database connection
database connection object
Database connection, specified as a database connection object created using database.
tablename — Database table name
string
Database table name, specified as a string denoting the name of a table in your database.
Data Types: char
colnames — Database table column names
cell array of strings