MATLAB Answers

fastinsert returns "Numeric value out of range" error, but insert works

7 views (last 30 days)
David Goldsmith
David Goldsmith on 7 Mar 2012
Hi! I have a situation where, on precisely the same data set, fastinsert is returning
"Java exception occurred: sun.jdbc.odbc.JdbcOdbcBatchUpdateException: [Microsoft][ODBC SQL Server Driver]Numeric value out of range"
but insert works. Looking at the help for fastinsert I see:
"...fastinsert ... supports more (emphasis added) object types than insert"
and the only exception to that I see documented is
"The fastinsert function only supports dates in U.S. format; that is, dates in mm/dd/yyyy format."
I did have this problem, but I corrected it (at least, the error I was getting before is different than the one cited above).
Is anyone aware of any other (undocumented) fastinsert limitations? Any other ideas?
Thanks!
  2 Comments
David Goldsmith
David Goldsmith on 7 Mar 2012
OK, I've narrowed the problem down to three fields that are type TINYINT in "my" DB ("my" is in quotes 'cause it's not really mine to do with as I please, or I'd just change these all to SMALLINT). I found the following in the Database Toolbox User's Guide, section "Before You Begin," sub-section "Supported Data Types":
TINYINT
Note The Database Toolbox software interprets this data type as BOOLEAN and imports it into the MATLAB workspace as logical true (1) or false (0).
As I had been trying to insert the maximum SQL Server documented value for this type, 255, that must've been the problem, right? Wrong: I changed it to zero and still got the same "Numeric value of range" error! But, again, insert has no problem with these, only fastinsert is balking--is this a known, undocumented "feature" of fastinsert? Or have I stumbled across a bug?

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by