How to determine the size used in a BLOB field?

kadee
Member Posts: 7
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 have been searching the Help, documentation and virtual tables, but without result

0
Comments
-
Hello,
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
Afonso0 -
WHat about this workaround:
export blob into file and get size of this file... :-)
I didn't found standard function for this...0 -
Here's an idea:
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
0 -
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.0 -
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?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions