![]() ![]()
SQL query to convert an image column value to text The SQL query would be as follows: SELECT CONVERT(varchar(max), CONVERT(varbinary(max), )) as įROM with(nolock) It wouldn't be a big problem to convert the saved value from bytes to text with Transact-SQL. As a result, it's stored as raw bytes in the SQL server database. The text value is saved by creating a stream for the BLOB field and writing the text into it. "Work Description".CreateOutStream(OutStream, TEXTENCODING::UTF8) ![]() Procedure SetWorkDescription(NewWorkDescription: Text) Message(ReadingDataSkippedMsg, FieldCaption("Work Description")) If not TypeHelper.TryReadAsTextWithSeparator(InStream, TypeHelper.LFSeparator(), WorkDescription) then ![]() "Work Description".CreateInStream(InStream, TEXTENCODING::UTF8) If a BLOB field is for storing a text value, it usually has its handler methods in the table which might look as follows (example from the Sales Header table, field Work Description): procedure GetWorkDescription() WorkDescription: Text Therefore, BLOB has been a reliable choice of a column type when we need to provide a way for adding detailed comments or descriptions where the length limitation of 250 characters would be an issue. It can hold text values far longer than a table field of type Text. The ProblemĪ BLOB field in Business Central corresponds to a database column of type image. BLOB FIELD WITH COMPRESSION DATA IS NOT VALID CODEThis blog post is for you if you're looking for a way to get the text values of a BLOB field directly from a SQL query without having to modify the Business Central code base. One interesting issue I've come across recently is reading a text value from a BLOB field.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |