From: Andrea C. P. <ac...@bi...> - 2002-07-29 17:59:58
|
Hi all, with Firebird 1 comes new function SUBSTRING. This function returns right value but create a field in the return cursor of a wrong lenght. An example: table test with field ftest char(10) table has 1 record '0123456789' if I run sql code select substring(ftest from 1 for 2) as subftest1,substring(ftest from 3 for 2) as subftest2,substring(ftest from 1 for 2) || substring(ftest from 3 for 2) as subftest3 from test it returns subftest1 subftest2 subftest3 ---------- ---------- ---------- 01 23 0123 and it is right but fields subftest1 and subftest2 are 10 char lenght so when in my application I do subftest1+subftest2 I have 01 23 and not 0123 Probably results fields are initialized as varchar(field lenght) and then filled with a null terminated string. It is not possible inizialize field as CHAR(len of FOR clause) in new firebird versions since we know the lenght we want return string? All database I worked with (DB2, ORACLE, SQL) returns exact lenght so I have a lot of applications to convert to firebird but a lot of line of code to adjust Thanks -- Andrea Chiadò Piat Bit Informatica s.r.l. Progettazione e Sviluppo |