Subject Re: [firebird-support] Blob Sub Type 1 and character limits with UTF8
Author Si Carter
Thanks Mark,

Originally noticed this as used in a SP, with parameters, the parameter being a blob which internally calls EXECUTE STATEMENT

SET TERM ^ ;
ALTER PROCEDURE REMOTEUPDATES (
    IPSQL Blob sub_type 1 )
AS
begin  
  EXECUTE STATEMENT ipSQL;
end^
SET TERM ; ^


So wondering now if Execute statement has this limit too?

On 24 November 2016 at 11:32, Mark Rotteveel mark@... [firebird-support] <firebird-support@yahoogroups.com> wrote:
 

On 24-11-2016 11:02, Si Carter s1cart3r@... [firebird-support] wrote:
> Using FB3 on windows I get the error message:
>
> String literal with 30465 characters exceeds the maximum length of 16383
> characters for the UTF8 character set
>
> As a test I created a new db (UTF8) with the following table
>
> CREATE TABLE WS_CUSTOM_PAGES
> (
> ID Bigint NOT NULL,
> PAGE_DATA Blob sub_type 1,
> CONSTRAINT PK_WS_CUSTOM_PAGES PRIMARY KEY (ID)
> );
>
> When inserting a record I get the following error:
>
>
> Message: isc_dsql_prepare failed
>
> SQL Message : -104
> can't format message 13:896 -- message file
> C:\WINDOWS\SYSTEM32\firebird. msg not found
>
> Engine Code : 335544569
> Engine Message :
> Dynamic SQL Error
> SQL error code = -104
> String literal with 30465 characters exceeds the maximum length of 16383
> characters for the UTF8 character set
>
> Have tried googling but no success and not sure if this is a limitation
> or not?

Blobs themselves don't have limits (or at least: the limit is orders of
magnitude greater), but string **literals** do have limits. Instead of
having the value in the query itself, you will need to parameterize the
query, populate a new blob and execute the query with that blob as the
parameter.

Mark
--
Mark Rotteveel