[fpc-pascal] TSQLQuery.ApplyUpdates problem with UTF-8

Tomas Hajny XHajT03 at hajny.biz
Tue Mar 25 10:01:38 CET 2014


On Tue, March 25, 2014 09:56, Dennis Poon wrote:
>
>>>
>>> By the way, why isn't a semicolon required at the end of SET NAMES
>>> 'utf8' command? I tried both with and without semicolon and neither
>>> raise an error.
>> Seems, that MySQL is tolerant to this.
>> MySQL supports MULTI_STATEMENTS, which enables client to pass multiple
>> statements separated by ";" in one string.
>> So may be, that MySQL interprets ";" as delimiter between multiple
>> statements on one batch.
>> If you use only one sql statement it is always better do not use
>> terminating ";" IMHO
>>
> The strange thing is, when we use MYSQL's interactive command line
> client, a semi colon is always required for EACH SQL Statement.

I don't know MySQL, but e.g. with Oracle and its SQL*Plus CLI this is
necessary so that the CLI knows that input of the SQL command is finished
on that line (rather than continuing on the following one). This is not
necessary when calling the API, because you cannot pass unfinished
commands there.

Tomas





More information about the fpc-pascal mailing list