Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Fetching Data Common Errors

This table describes how to address common errors you might encounter while working with Database Toolbox™. These errors might occur in either Database Explorer or the command line when using exec or fetch.

VendorError MessageProbable CausesResolution

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 executing exec but before executing fetch. This error happens only with the command line.

Add 'SET NOCOUNT ON' at the beginning of your stored procedure. For details, see exec.

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 executing fetch. This error happens either with Database Explorer or the command line.

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 preview does not support.

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 executing fetch. This error happens only with the command line.

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 executing exec but before executing fetch. This error happens either with Database Explorer or the command line.

Write custom code. Write the code for connecting to your database via the command line. Then write the following.

set(conn,'AutoCommit','off');

h = conn.Handle;

stmt = h.createStatement();

stmt.setFetchSize(50);

rs = stmt.executeQuery(java.lang.String('SELECT * FROM largeData where productnumber <= 3000000'));

Modify the previous statement to include your SQL query instead.

Then process the result set object rs in batches.

See Also

|

Related Topics

Was this topic helpful?