database toolbox: SQL Query on datatype "image" is limited to 8000 1Byte values
Show older comments
In matlab Version 7.0 (2016b) it was possible to make a query on Image datatype in SQL for more then 8000 1Byte values. Now in matlab Version 7.1 (2017a) the queryresult is limited to the first 8000 values. In ver7.0 the result was int8 in ver7.1 the result is uint8
For example there is a database called "LocalDB" with a table called "dbo.Test" and a field called "imagedatafield" with datatype image and one column with 11000 Byte values
code with matlab ver 7.0
setdbprefs('DataReturnFormat', 'structure');
conn = database('LocalDB','','');
SqlStr = ['SELECT imagedatafield FROM dbo.Test];
result = fetch(conn,SqlStr);
result.imagedatafield
ans =
java.lang.Object[][]:
[11000×1 int8]
code with matlab ver 7.1 (the same code on the same database as with ver 7.0)
setdbprefs('DataReturnFormat', 'structure'); conn = database('LocalDB','',''); SqlStr = ['SELECT imagedatafield FROM dbo.Test]; result = fetch(conn,SqlStr); result.imagedatafield
ans =
cell
[8000×1 uint8]
Is there a way to get all data of a datatype "Image" and not just the first 8000 ??
Answers (1)
Anoop Somashekar
on 28 Mar 2017
0 votes
From 2017a onwards, JDBC-ODBC bridge interface was migrated to Native-ODBC interface. Native-ODBC interface is not equipped to deal with long data-types such as BLOB, TEXT, NVARCHAR(MAX), VARCHAR(MAX), IMAGE etc.There are certain technical limitations to support these data types in Native-ODBC interface therefore it was decided to limit the number of bytes per column to 8000 bytes for long types (including image types). This is a known limitation in Native-ODBC interface.
3 Comments
Georgio Mazarin
on 3 Apr 2017
Anoop Somashekar, okay Native-ODBC interface can't. Do you now which ODBC is able to? Any ideas how do we load large data amounts from blob cols? p.s. I'm use varbinary(max) instead of image, effect is the same.
Georgio Mazarin
on 4 Apr 2017
Solved, JDBC can.
Joe Kleespies
on 25 Aug 2017
Georgio, can you describe how you were able to solve this problem with JDBC? Using the JDBC driver still limits the columns to 8000 bytes for me.
Categories
Find more on Database Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!