on 2020 Jun 10 11:42 AM
The v16 & v17 documents (all versions including the SAP Help one) imply that the input to Base64_encode() should be a string - which seems to miss the whole point of the exercise 🙂 In fact it takes a long binary quite happily:
create variable blah1 long binary; create variable blah2 long varchar; create variable blah3 long binary; set blah1 = xp_read_file('c:\\tmp\\mark.tif'); set blah2 = base64_encode(blah1); set blah3 = base64_decode(blah2); call xp_write_file('c:\\tmp\\markOUT.tif',blah3 );with an 8MB tiff
I know that a related issue was discussed in this question back in 2014. But it would avoid a lot of confusion if the documentation for the relevant functions could make it clear when they can handle binary data. (I've just spent some time explaining to someone that thye don't need to convert their binary data to a string so they can convert it to a string so that they .... you get the idea!)
Request clarification before answering.
I've recommended an update to the docs to help make this more clear. The difficulty with many of these functions is that they accept arguments of all sorts of types and then convert the input argument to whatever seems to be the most appropriate for that type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FWIW the EXPRTYPE function is useful to answer the question "Just exactly what is the data type at this point?"
For grins and giggles, check the return data type for the STRING() function.
Yikes. That's the function that returns different things based on atmospheric pressure.
User | Count |
---|---|
75 | |
30 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.