VARCHAR(Max) limited to 1024 characters with BigText

spider1269
Member Posts: 77
I'm populating a BigText variable from a Stored proc. The output of the stored proc is VarChar(Max). For some reason the following statement doesn't work.
If I add a FORMAT to the above statement it will work but only if the varchar is <= 1024 characters.
Any idea how to get more than 1024 characters to work with BigText?
Thanks.
tmpText.ADDTEXT(lADORecordset.Fields.Item(0).Value);
If I add a FORMAT to the above statement it will work but only if the varchar is <= 1024 characters.
tmpText.ADDTEXT(FORMAT(ADORecordset.Fields.Item(0).Value));
Any idea how to get more than 1024 characters to work with BigText?
Thanks.
0
Answers
-
No way. when you doing assignment in C/AL, system put your varchar to text buffer. Text buffer is limited to 1024. The same with BSTR, and any other long text data type, even variant0
-
Is there any other way to do this other than parsing the data before it comes to NAV?0
-
I was able to solve this using ADO Stream. Works like a charm.0
-
Im always curious how and learning...want to share?0
-
Basically, there is two options: ADOstream or third party dll. ADOstreams are better as they are part of system, and you don't need to install something on client machines.0
-
ADOStream.Open; ADOStream.WriteText(lADORecordset.Fields.Item(0).Value); ADOStream.Position := 0; WHILE NOT ADOStream.EOS DO BEGIN TargetText.ADDTEXT(FORMAT(ADOStream.ReadText(1024)),y); y += 1024; END; ADOStream.Close;
The ADOStream variable is automation(Stream) and the TargetText is BigText. I'm updating the TargetText variable 1024 characters at a time but you could always use a smaller value.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