Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Unexpected conversion
Tue, Feb 25 2020 3:11 AMPermanent Link

Ian Branch

Avatar

Hi Team,
I have a table with a field defined as a BigInt.
The Customer has decided he wants the field to now be alphanumeric.
There are currently vaues in the field up to 15 digits.
Using edbmgr I changed the field from BigInt to Varchar 15 nullable.
Imagine my surprise when the values were changed to anything but what they looked like and the thighest 'value' was 9999.

Why is it so?

Ian
Tue, Feb 25 2020 3:48 AMPermanent Link

Ian Branch

Avatar

Ah Ha! it did what it was supposed to do.
The 'numbers' are now sorted hierarchically from 0 to 9.
1111111 comes before 22
Hmm, that's no good for this purpose.
Tue, Feb 25 2020 5:57 AMPermanent Link

Matthew Jones

Ian Branch wrote:

> Ah Ha! it did what it was supposed to do.
> The 'numbers' are now sorted hierarchically from 0 to 9.
> 1111111 comes before 22
> Hmm, that's no good for this purpose.

Presumably you could run through one pass and pad them with 0's to the left to the required length?

--

Matthew Jones
Tue, Feb 25 2020 6:50 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


Agree pretty much with what Matthew said. All I would add is that 15 numbers sounds like a bar code, ISBN or whatever the musical equivalent is. If my guess is right then find out how its validated and build in.

Roy Lambert
Wed, Feb 26 2020 10:05 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Ian,

<<The Customer has decided he wants the field to now be alphanumeric.>>

Why? Does he need to add letters to it or still only digits?

Image