One of our customers wants to embedd an PDF file in an EHF Invoice XML file. And they need it to be BASE64 encoded. So I've read the file into a blob and are trying to encode it using SQL Anywhere 16's builtin base64_encode(string) function. The PDF file is 92344 bytes, and the blob has that length after this command (PowerBuilder code):
Then I try to base64 encode it using this command:
The command executes without error, but the string containing the BASE64 encoded PDF is only 32767 bytes, and should be closer to 120.000 (due to some overhead in the BASE64 encoding). The VARCHAR datatype in SQL Anywhere is 32767 long, but the base64_encode() function is supposed to return a long varchar string, which is approx 2 GB in size. (I've also tried to insert the data into a #temp table, but the the encoded string is still only 32767).
Can anyone see if there is something I'm doing wrong?
Or if there is another approach to solving this issue?
I've looked into running
asked 06 Jan, 09:47