Subject | Read only databases and procedure blobs |
---|---|
Author | Geoff Worboys |
Post date | 2006-02-15T01:04:33Z |
Hi All,
I have a stored procedure in which a UDF tries to return
a large text value as a blob. Here is a simplified example:
CREATE PROCEDURE MY_PROC( REQUEST_TYPE SMALLINT )
RETURNS ( MY_TEXT BLOB )
AS
BEGIN
MY_TEXT = GetLotsOfTextUDF( REQUEST_TYPE );
END
This works well in a normal database. In a readonly database
it gives the error:
ISC ERROR CODE:335544765
ISC ERROR MESSAGE:
attempted update on read-only database
Obviously there is nothing in the above that does a permanent
change to the database, but knowing a little bit about how
blobs work in FB/IB the result is not entirely surprising.
The question is; Is this considered a bug (or at least a
problem) that is intended to be fixed? Or is it all simply
working as designed with no intention to change it?
I guess a related question would be:
Is the above (returning blobs from stored procedures that have
no table/field for the source) considered a "bad idea"?
That is; Even though it works it is obviously using the
database for temporary storage of the blob (hence the problem
with readonly databases). Is such an implementation frowned
on by those that know better, or is the feature expected to
be used.
--
Geoff Worboys
Telesis Computing
I have a stored procedure in which a UDF tries to return
a large text value as a blob. Here is a simplified example:
CREATE PROCEDURE MY_PROC( REQUEST_TYPE SMALLINT )
RETURNS ( MY_TEXT BLOB )
AS
BEGIN
MY_TEXT = GetLotsOfTextUDF( REQUEST_TYPE );
END
This works well in a normal database. In a readonly database
it gives the error:
ISC ERROR CODE:335544765
ISC ERROR MESSAGE:
attempted update on read-only database
Obviously there is nothing in the above that does a permanent
change to the database, but knowing a little bit about how
blobs work in FB/IB the result is not entirely surprising.
The question is; Is this considered a bug (or at least a
problem) that is intended to be fixed? Or is it all simply
working as designed with no intention to change it?
I guess a related question would be:
Is the above (returning blobs from stored procedures that have
no table/field for the source) considered a "bad idea"?
That is; Even though it works it is obviously using the
database for temporary storage of the blob (hence the problem
with readonly databases). Is such an implementation frowned
on by those that know better, or is the feature expected to
be used.
--
Geoff Worboys
Telesis Computing