Importing Data Common Errors
Address common errors that you can encounter when importing data from databases and customizing import options.
Data Import Common Errors
The following table describes errors that can occur in either the Database Explorer app
or the command line when you use the fetch
, sqlinnerjoin
,
and sqlouterjoin
functions.
Vendor | Error Message | Probable Causes | Resolution |
---|---|---|---|
All | Must provide either the "Keys" value, or both the "LeftKeys" and
"RightKeys" values. | You specified only the 'LeftKeys' or
'RightKeys' name-value pair argument. | Specify the |
Multiple table entry found for | The database contains multiple tables with the same name across catalogs and schemas. | Specify the | |
Unable to find information for table
| The function cannot find information about the specified database table. | Specify the | |
Unable to find columns for table
| The function cannot find information about the columns of the specified database table. | Specify the | |
Unable to find common keys for table
| The function cannot find common keys between the specified left and right tables to join. | Specify the | |
The number of key variables on the left and right must be the
same. | The number of specified keys for the left and right tables do not match. | Specify the same number of keys for the 'LeftKeys' and
'RightKeys' name-value pair arguments. | |
Microsoft® SQL Server® | The statement did not return a result set. | There are other SQL statements in the middle of the stored procedure.
This error happens after you execute | Add |
Microsoft SQL Server | JDBC Driver 3.0 returns incorrect date values when used with
JRE™ 1.7 by a Java® application. | There is an issue with the Microsoft
SQL Server JDBC Driver 3.0. This error happens after you execute | Install a hotfix from Microsoft for JDBC Driver 3.0. Alternatively, upgrade your Microsoft SQL Server JDBC driver to version 4.0. |
Microsoft SQL Server | Connection is busy with results for another
command. | You are connecting to Microsoft
SQL Server using a driver that | Connect to Microsoft SQL Server using the JDBC driver. |
Oracle® | Stored procedures and functions return result sets as cursor
types. | The JDBC driver returns stored procedure and function result sets as
custom Java objects. This error happens after you execute | Write custom MATLAB® code to process the Java objects into MATLAB variables. |
PostgreSQL | Java exception occurred: java.lang.OutOfMemoryError: Java heap
space | The JDBC driver caches results in the memory. There is not enough memory
in the Java heap to store the large amount of data fetched from your database.
This error happens after you execute | Write custom code. Write the code for connecting to your database via the command line. Then write the following.
Modify the previous statement to include your SQL query instead. Then process the result
set object |
Custom Import Options Common Errors
The following table describes errors that can occur when you use the SQLImportOptions
object to customize options for importing data from a database. These error messages apply
across all database vendors.
Error Message | Probable Causes | Resolution |
---|---|---|
Calling | You did not specify an output argument when executing the
| Use the |
| The specified input argument has an invalid data type. | The input argument must be a character vector or cell array of character vectors. |
Unknown variable name:
'' | The specified variable name is invalid. | Specify a variable name that exists in the
|
Variable selection out of range. Vector must contain integers
between 1 and N, where N is the number of variables in the import
options. | The specified index value is out of bounds within the number of selected variables. | Specify an index that is in the range of the number of variables in the
|
Expected a name or numeric index of a variable
name. | The data type of the specified input argument is invalid. | The input argument must be a numeric index or a variable name. |
Cell array of types must be a vector of length
| The length of the specified data types is invalid. | When you set the VariableTypes property of the SQLImportOptions object, the length of the cell array must be equal to
the number of variables. |
Cell array of names must be a vector of length
| The length of the specified variable names is invalid. | When you set the VariableNames property of the SQLImportOptions object, the length of the cell array must be equal to
the number of variables. |
See Also
fetch
| setoptions
| getoptions
| sqlinnerjoin
| sqlouterjoin