how to import specific cell(s) from table of database to Matlab?
Show older comments
Hi,
I have the database toolbox, and I am trying to import the information that is contained in specific cells of a table from the database to Matlab. I have tried several things, among others:
if true
% conn = database('myfirstsource', '', '');
setdbprefs('DataReturnFormat','cellarray');
curs = exec(conn, 'select * from userPassword');
columnnames(curs);
entries=curs.Data(:,1)
end
But it does not work. what i have returned is:
curs =
Attributes: []
Data: 0
DatabaseObject: [1x1 database]
RowLimit: 0
SQLQuery: 'select * from userPassword'
Message: []
Type: 'Database Cursor Object'
ResultSet: [1x1 sun.jdbc.odbc.JdbcOdbcResultSet]
Cursor: [1x1 com.mathworks.toolbox.database.sqlExec]
Statement: [1x1 sun.jdbc.odbc.JdbcOdbcStatement]
Fetch: 0
ans =
[]
entries =
0
Why is the above code not returning the cells in the table? What am I missing?
Please help.
Thank you.
1 Comment
MatlabFan
on 7 Apr 2013
Answers (0)
Categories
Find more on Database Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!