In Microsoft Dynamics NAV tables, we can create BLOB fields to store large amount of data. It is not possible to read the data in the BLOB fields directly.
The following steps shows the procedure to read the BLOB data. In this example, I have taken “User Metadata” table to read the data in the “Page Metadate Delta” field.
1) Create a codeunit with the below variables.
Name | DataType | Subtype | Length |
UserMetadata | Record | User Metadata | |
Data | InStream | ||
Line | Text | 1024 | |
Pos | Integer | ||
File1 | File |
2) Add the following code to the codeunit.
3) Save and Run the codeunit. Text file will be created in the given path with the data in the BLOB field.
Thanks,
Veerendra CH.
How do I import the Test.txt?
ReplyDeleteThank you.
Hi Veerendra
ReplyDeleteThis code is perfect - thank you for posting this!!
Chris
Thank you very much! :)
ReplyDeleteI get an Error "The table contains a BLOB field with invalid compression data:....."
ReplyDeleteWould you know why this is the case? I had inserted the BLOB field through SQL Server Script. And the Compression Type is set to Yes in Navision. Does these things have to do anything with the Error?