SQL Server balks at create of BLOB field

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tonymeadors
Posts: 35
Joined: Wed 28 Feb 2007 17:56

SQL Server balks at create of BLOB field

Post by tonymeadors » Wed 28 Sep 2011 14:20

Background:
[i][i]We are moving a huge suite of tools from D7 to D2010 and changing
from dbexpress connections to unidac-based connections.

With the same software we support IB, FB, MSSQL & Oracle.
The bear is dealing with all the datatype oddities.[/i][/i]


Seems that sql server balks at creating table with field datatype BLOB.

q.sql.add( 'create table simple(xinteger integer, xblob blob) ' );
q.execsql;

Yields error:

"...raised exception class EMSError with message 'Comun, parameter, or variable #2: Cannot find data type BLOB."

Same DDL:
oracle works
interbase works
sql server errors
(sql server 2005 that has always supported blobs through dbexpress components)

Looking for similar code to work with most data/query activities.

sincerely,
tonyM

AndreyZ

Post by AndreyZ » Thu 29 Sep 2011 15:43

SQL Server doesn't have the BLOB type. You can use the VARBINARY(MAX) type instead. You can find more information about SQL Server types here: http://msdn.microsoft.com/en-us/library/ms187752.aspx

tonymeadors
Posts: 35
Joined: Wed 28 Feb 2007 17:56

Post by tonymeadors » Fri 30 Sep 2011 17:37

Yup,

You are exactly right.
We have used IMAGE for sql server binary for
years - but our hasty testing ignored that fact.

Thank you,

tonyM

Post Reply