Does anyone know how to determine the size used in a BLOB field, in a native Navision environment?
I have been searching the Help, documentation and virtual tables, but without result
I think this is a limited size field, you can input files until a certain size, i don't remember the exact size, but you cannot change the size used in the BLOB.
VAR
CompanyInfo : Record 79;
InStreamObj : InStream;
intLen : Integer;
intBytesRead : Integer;
binVariable : Binary[250];
BEGIN
intLen := 0;
CompanyInfo.GET;
CompanyInfo.CALCFIELDS(Picture);
CompanyInfo.Picture.CREATEINSTREAM(InStreamObj);
REPEAT
intBytesRead := InStreamObj.READ(binVariable);
intLen += intBytesRead;
UNTIL intBytesRead = 0;
MESSAGE('Company Info Picture length is %1.',FORMAT(intLen));
END
I guess determination based on an export via OutStream would be the more appealing way to choose here; too bad it can't be used for intensive operations with big files.
Anyway, thanks for the replies, folks.
I'm not sure why you say 'export' and 'OutStream'. My recommendation does not require a BLOB.Export to a file, nor does it use an OutStream object.
The 'InStream' I suggested is used as a way to 'stream the contents of the BLOB field into a local variable', counting the bytes along the way. No external file is created.
It seems that this method should work acceptably, even with large BLOB's, no?
Comments
I think this is a limited size field, you can input files until a certain size, i don't remember the exact size, but you cannot change the size used in the BLOB.
Regards
Afonso
export blob into file and get size of this file... :-)
I didn't found standard function for this...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Anyway, thanks for the replies, folks.
The 'InStream' I suggested is used as a way to 'stream the contents of the BLOB field into a local variable', counting the bytes along the way. No external file is created.
It seems that this method should work acceptably, even with large BLOB's, no?