www.gusucode.com > database 案例源码程序 matlab代码 > database/ImportDataMATLABInterfaceToSQLiteExample.m

    %% Import Data Using the MATLAB(R) Interface to SQLite
% Create a SQLite connection |conn| to an existing SQLite database file
% |tutorial.db|.
%% 
dbfile = 'tutorial.db';

conn = sqlite(dbfile);
%%
% Import the |productDescription| column from the |productTable| by using
% the |rowlimit| argument.
%%
sqlquery = 'select productdescription from productTable';
rowlimit = 5;

results = fetch(conn,sqlquery,rowlimit);
%%
% |results| returns five rows of data.
%%
% Close the SQLite connection.
close(conn)