Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: How to use mssql varbinary type with SB ?
Hello!
I'm trying to map an existing MS SQL table to a Service Builder table. The original table has a VARBINARY typed column.
How should be it using with SB? Which type should I use for mapping this field?
what kind of data is it?
I don't think there's any support for blob fields, you may have to go native to get to the input stream for the blob...
David H Nebinger:I don't think there's any support for blob fields, you may have to go native to get to the input stream for the blob...
Liferay has just enough support for blob fields to implement the
DLContent table, where the data field is
declared as a Blob.
For SQL Server, Liferay will auto-generate table create statements
that have those fields declared as (currently
deprecated) image type, but Liferay otherwise
interacts with it at the JDBC level as though it's a
java.sql.Blob. Therefore, I suspect that if the
underlying table uses an nvarbinary, everything should
work just fine, even without LPS-62804 implemented.
Thank you Minhchau! Thank you David!
I thought about Blobs too. But this case was successfully avoid by changing data type to VARCHAR2 for that column was considered for some crypto hash to be stored. So I haven't had a chance to test this with Blob yet.. But I suspect I'll have to face to this stuff with this ancient SQL-database. I'm going to write down here about this experience as it will happen.