MATLAB: Do I get the ??? Undefined function or variable ‘getTheMetaData’. error message with the Database Toolbox

Database Toolbox

??? Undefined function or variable 'getTheMetaData'.
Error in ==>
\\matlab\toolbox\database\database\@cursor\columnnames.m
On line 46 ==> md = getTheMetaData(cursor.Fetch);
Error in ==> matlab\toolbox\database\vqb\querycallbacks.m
On line 749 ==> tmp = columnnames(ex);
??? Error while evaluating uicontrol Callback.

Best Answer

This error message indicates that you are trying to connect to a database in read-only mode. The MATLAB Visual Query Builder does not support read-only connections. You initially will be able to connect to the database with a read-only username and password; but subsequent operations will generate errors.
To make a read-only connection, use the command line functionality of the Database Toolbox. e.g.
% Make connection to a database called SampleDB with username
% scott and password tiger
conn=database('SampleDB','scott','tiger');
% Execute a valid SQL statement against the database connection, conn
% and opens a cursor
curs = exec( conn, 'select freight from orders' );
% Import data from the open SQL cursor curs.
curs = fetch(curs);
For more information on using the Database Toolbox functions, please refer to Chapter 3 of the Database Toolbox User's Guide.