Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Substring BUG
Mon, Jan 15 2007 4:12 PMPermanent Link

"Jose Eduardo Helminsky"
Tim

Table1 structure:

Recno    Field1        Field2
------    ---------    --------
1            12345
2            12367
3            92341
4            12312
5            <empty>
6            56789
7            <empty>

update table1 set field2=substring(field1 from 4 for 2)

Recno    Field1        Field2
------    ---------    --------
1            12345        45
2            12367        67
3            92341        41
4            12312        12
5            <empty>    12   <----------------- I think it must be empty
because substring is ''
6            56789        89
7            <empty>    89   <----------------- I think it must be empty
because substring is ''

I know I can solve this problem adding a where clause "where field1 <> null"
but....

I am using 4.22 build 6 but I have tested it with DBSys 4.25 build 3

Eduardo

Tue, Jan 16 2007 8:56 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Eduardo,

<< I know I can solve this problem adding a where clause "where field1 <>
null" but....

I am using 4.22 build 6 but I have tested it with DBSys 4.25 build 3 >>

Yes, you are correct.  There are a couple of string functions that aren't
performing a NULL test because they are assuming NULL=empty string for the
expression, which is not always the case internally.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image