Subject Re: [firebird-support] Dynamic statement construction and BLOB variables in SP
Author Helen Borrie
On 24 Jul 2006 at 13:12, Miroslav Penchev wrote:
>I have a problem executing that simple SP:
>declare variable from_part blob sub_type 1 segment size 80;
>declare variable temp_str blob sub_type 1 segment size 80;
> from_part = 'VIEW_DOCUMENT_DATA';
> temp_str = 'SELECT * FROM ' || :from_part;
>On execution of second line I get error "Column unknown.
>I am try to assemble a complex SQL statement to execute it with EXECUTE
>STATEMENT. I am missing something? If local variables are VARCHARs
>everything is OK.

At 09:31 PM 24/07/2006, Dimitry Sibiryakov wrote:

> You can't work with BLOBs in PSQL.

That's not altogether true and it's not the cause of the problem here.

from_part = 'VIEW_DOCUMENT_DATA';
You can't assign a string to a blob.

temp_str = 'SELECT * FROM ' || :from_part;
You can't concatenate a blob to anything.

Why would you want to use a blob here anyway?

Did you know that it is also pointless to define a segment size for a blob?