do I understand correctly that the IExternalProcedureImpl::getCharSet
allows me to tell engine in what charset I want the varchar/char values?
Because although I have UTF-8 hardcoded there, when I declare procedure
parameter as "result varchar(1) character set ascii" I'm getting
length==1 in metadata (metadata->getLength(status, i)), while when I
omit the "character set ascii" I get the expected length==4.
On 27/07/2017 03:01, Jiří Činčura wrote:
> Looks like it has no effect, though it is called. Using WIN1250 there
> and I'm still getting the varchars in UTF-8 (connection charset). So
> it probably has different purpose?
This method changes the connection charset whiling the execute/open
method is in progress.
It does not change how parameters are described.
I suppose you can use ExternalEngine::getCharSet to change the default
charset to map parameters.
On 01/08/2017 02:52, Jiří Činčura wrote:
>> This method changes the connection charset whiling the execute/open
>> method is in progress.
> What is this good for?
When an attachment runs external code, it may be in three different
- User (client) code (PSQL / SQL)
- Plugin management code (it may use user's attachment)
- User (server) code called from plugin
Each of these states may be completely different beasts, so require
customization of connection charset.
>> It does not change how parameters are described.
>> I suppose you can use ExternalEngine::getCharSet to change the default
>> charset to map parameters.
> You mean IMetadataBuilder, right?
I mean ExternalEngine::getCharSet, the function to set connection
charset for plugin management code.
If you set charset there, I suppose IMessageMetadata will be already in
its charset, but I'm not looking in the code and may be wrong.