1

Topic: SUBSTRING and field size

SELECT SUBSTRING (COLUMN1 from 10 for 20).....
In Firebird 2.5 type of a returned column will be same, as at COLUMN1
Despite explicit restriction of field length in request.
It is specified "for 20" - on idea on an output should receive VarChar (20) if the length of an initial column is more, but FB2.x it does not consider, demands explicit CAST.
In FB 3/4 and remains, the forced reduction of length of the text in SUBSTRING is not considered?

2

Re: SUBSTRING and field size

Arioch;
Why the freakish? from and to can be and variables

3

Re: SUBSTRING and field size

Simonov Denis;
Yes, can, it seems since 2.1.
.... It is a pity that constants not .
And values of these variables/expressions are calculated anew for every line?
It is impossible to count them at stage PREPARE?

4

Re: SUBSTRING and field size

Arioch;
Variables are not present certainly. Constants probably it is possible

5

Re: SUBSTRING and field size

Generally, it is good at functions probably completely to specify the size.
Not VarChar, and VarChar (xxx)
Because in 64-kb p it is possible to be knocked elementarily
https://www.firebirdsql.org/file/docume … ons-string