Discussion:
[firebird-support] Blob Sub Type 1 and character limits with UTF8
Si Carter s1cart3r@gmail.com [firebird-support]
2016-11-24 10:02:20 UTC
Permalink
Hi,

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?

any help appreciated

Si
Mark Rotteveel mark@lawinegevaar.nl [firebird-support]
2016-11-24 10:32:01 UTC
Permalink
Post by Si Carter ***@gmail.com [firebird-support]
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)
);
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
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
Si Carter s1cart3r@gmail.com [firebird-support]
2016-11-24 14:35:19 UTC
Permalink
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?
Post by Mark Rotteveel ***@lawinegevaar.nl [firebird-support]
Post by Si Carter ***@gmail.com [firebird-support]
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)
);
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
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
Dimitry Sibiryakov sd@ibphoenix.com [firebird-support]
2016-11-24 16:49:02 UTC
Permalink
Post by Si Carter ***@gmail.com [firebird-support]
So wondering now if Execute statement has this limit too?
EXECUTE STATEMENT has VARCHAR as the first parameter.
--
WBR, SD.


------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-***@yahoogroups.com
firebird-support-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-***@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/
fabianch@itbizolutions.com.au [firebird-support]
2016-11-24 18:59:47 UTC
Permalink
Just wondering can my app start a transaction with Begin Transaction and
then call a stored procedure that contains the SUSPEND sentence at the end
while the transaction is still opened? Is there any special consideration
when comencing a transaction other than to ensure the process finished as
soon as posible with a commit or rollback, and no human intervention is
needed in between Begin Transaction and Commit , such as messages on screen
or buttons needed to be pressed, etc?



------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-***@yahoogroups.com
firebird-support-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-***@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/
Dimitry Sibiryakov sd@ibphoenix.com [firebird-support]
2016-11-24 20:02:30 UTC
Permalink
Post by ***@itbizolutions.com.au [firebird-support]
can my app start a transaction with Begin Transaction and
then call a stored procedure that contains the SUSPEND sentence at the end
while the transaction is still opened?
SUSPEND has nothing to do with transaction. It breaks atomicity of the statement
savepoint, but not transaction.
--
WBR, SD.


------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-***@yahoogroups.com
firebird-support-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-***@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/
Ann Harrison aharrison@ibphoenix.com [firebird-support]
2016-11-25 13:09:31 UTC
Permalink
Post by ***@itbizolutions.com.au [firebird-support]
Just wondering can my app start a transaction with Begin Transaction and
then call a stored procedure that contains the SUSPEND sentence at the end
while the transaction is still opened?
Yes a transaction can include invoking a procedure that includes SUSPEND.
Post by ***@itbizolutions.com.au [firebird-support]
Is there any special consideration
when comencing a transaction other than to ensure the process finished as
soon as posible with a commit or rollback, and no human intervention is
needed in between Begin Transaction and Commit , such as messages on screen
or buttons needed to be pressed, etc?
In general, transactions should be kept short, but your definition is limiting. A transaction is a single logical unit of work that should be executed in a consistent setting. If that involves human interaction, fine, as long as you have some mechanism to limit the response time. You don't want to hold a transaction open for hours - and in some applications even for minutes - but sometimes branching and human interaction are important. Firebird's MVCC was designed to provide consistent results while allowing interaction - as opposed to a lock-based serializable consistency that generates read/write deadlocks.

Good luck,

Ann
Post by ***@itbizolutions.com.au [firebird-support]
------------------------------------
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu there.
Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------
Yahoo Groups Links
Si Carter s1cart3r@gmail.com [firebird-support]
2016-11-25 09:11:28 UTC
Permalink
Thanks, didn't find any reference to requiring varchar in docs, although
all examples are varchar's.

regards

Si
Post by Dimitry Sibiryakov ***@ibphoenix.com [firebird-support]
Post by Si Carter ***@gmail.com [firebird-support]
So wondering now if Execute statement has this limit too?
EXECUTE STATEMENT has VARCHAR as the first parameter.
--
WBR, SD.
------------------------------------
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu there.
Also search the knowledgebases at http://www.ibphoenix.com/
resources/documents/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------
Yahoo Groups Links
Loading...