Adriano,

> > select  char_length( SUBSTRING(col1 from 1 for 20)) from tbl_test     
> > returns
> 20 so I was expecting index to work.
> >
> > workaround
> > CREATE INDEX IDX1 ON tbl_test COMPUTED BY (CAST(SUBSTRING(col1
> from 1
> > for 20) as varchar(20)))
> >
> This issue depends if we're allowed to change SUBSTRING with constant
> length to describe the result with that length instead of the value one, like
> we do with *PAD.
> 
> Accordingly to the standard, substring "should" be described as returning the
> same type of the value.

By "type" does the standard mean the basic data type as well as the length?

It would seem logical (which runs against the standard) that substring type 
functions implicitly override the length of the source value, thus the length 
of the substring should apply.


Sean


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to