Subject Re: [firebird-support] Re: cast blob sub_type 1 to varchar
Author Fabiano Bonin
In Firebird 2.1, if you do

select substring(blob_field from 1 for 20) from table

the result field will be a blob field.
In FB 2.0 it would return a varchar

So, if you need a varchar field in the result, you should do

select cast(substring(blob_field from 1 for 20) as varchar(20)) from table

Regards,

Fabiano

On Fri, May 30, 2008 at 3:35 PM, danyschaer <danyschaer@...> wrote:
> Hi All;
>
> Yes, I am trying noy your
>
> SELECT SUBSTRING("TEXT" FROM 1 FOR 20) FROM "MOVI"
>
> and it works but ... the truth is that I was trying to use a standard
> sql to make my sentences compatible with Firebird & Oracle & PostgreSQL.
>
> select cast("TEXT" as varchar(20)) from "MOVI" ... works in Oracle and
> PostgreSQL.
>
> SELECT SUBSTRING("TEXT" FROM 1 FOR 20) FROM "MOVI" works only in
> Firebird, I guess.
>
> Dany
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>
>