Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 18 of 18 total
Thread String field value ''
Mon, Nov 19 2007 3:36 PMPermanent Link

"Royke"
So, basically the user of our software no longer has the option to make a
field NULL?

Yes, we are assuming that a string field cannot have value '', as this is a
conversion from a BDE app.

The reason we noticed this is as some filter expression went wrong. Maybe I
should check those one more time first.

RJ


"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:A8BB07FF-2266-422A-BE60-97C04FE1350A@news.elevatesoft.com...
> Roy,
>
> << Assuming that you now both agree that a string field can have value '':
> when it has value 'abcd', and the user empties its DBEdit (F2, to to end,
> 4x BS), what is the resulting new value? '' or NULL? >>
>
> The new value is a non-NULL '' (blank string).  In the ElevateDB Manager,
> for example, you'll notice that the right-click popup menu for the data
> grids has an option to set a column to NULL explicitly.  This is because
> there really is no facility for doing so in a TDBGrid.
>
> << In more practical terms: are we now supposed to go through our whole
> application and replace all/most occurences of "if not field.isnull then"
> with "if not field.isnull and (field.asstring <> '') then" ?? >>
>
> Only if you're assuming that setting a string field's value to '' will
> also make the field NULL like DBISAM did.  For some this was an important
> distinction, while for others it doesn't matter.
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>

Mon, Nov 19 2007 4:50 PMPermanent Link

"Terry Swiers"
Tim,

> The new value is a non-NULL '' (blank string).  In the ElevateDB Manager,
> for example, you'll notice that the right-click popup menu for the data
> grids has an option to set a column to NULL explicitly.  This is because
> there really is no facility for doing so in a TDBGrid.

I'm just now starting to work with EDB and struggling with this particular
issue.  So, I have to ask...

Is there any way that we can talk you into adding a global EDB option at the
engine level that would instruct EDB to set string fields to NULL when
passed a string with a zero length?   This would allow me to focus on
actually developing my application and not have to worry about setting up a
trigger or some other cluge just to make sure that all empty strings are
converted to nulls.

Just hoping.

--

---------------------------------------
 Terry Swiers
 Millennium Software, LLC
 http://www.1000years.com
 http://www.atrex.com

 Atrex Inventory Control/POS -
    Big business features without spending big business bucks!

Atrex Electronic Support Options:
 Atrex Knowledgebase: http://www.atrex.com/atrexkb.asp
 Email: mailto:support@atrex.com
 Newsgroup: news://news.1000years.com/millennium.atrex
 Fax: 1-925-829-1851
 Phone: 1-925-828-5892 (M-F, 9a-5p Pacific)
 ---------------------------------------

Mon, Nov 19 2007 6:53 PMPermanent Link

"Royke"
And maybe that same setting can then also make trailing spaces disappear.
These two issues, which are really one, are causing a huge amount of work
and checking in BDE app conversions.

RJ

"Terry Swiers" <millennium@1000years.com> wrote in message
news:42829676-977C-470C-8E2B-631D7141E010@news.elevatesoft.com...
> Tim,
>
>> The new value is a non-NULL '' (blank string).  In the ElevateDB Manager,
>> for example, you'll notice that the right-click popup menu for the data
>> grids has an option to set a column to NULL explicitly.  This is because
>> there really is no facility for doing so in a TDBGrid.
>
> I'm just now starting to work with EDB and struggling with this particular
> issue.  So, I have to ask...
>
> Is there any way that we can talk you into adding a global EDB option at
> the engine level that would instruct EDB to set string fields to NULL when
> passed a string with a zero length?   This would allow me to focus on
> actually developing my application and not have to worry about setting up
> a trigger or some other cluge just to make sure that all empty strings are
> converted to nulls.
>
> Just hoping.
>
> --
>
> ---------------------------------------
>  Terry Swiers
>  Millennium Software, LLC
>  http://www.1000years.com
>  http://www.atrex.com
>
>  Atrex Inventory Control/POS -
>     Big business features without spending big business bucks!
>
> Atrex Electronic Support Options:
>  Atrex Knowledgebase: http://www.atrex.com/atrexkb.asp
>  Email: mailto:support@atrex.com
>  Newsgroup: news://news.1000years.com/millennium.atrex
>  Fax: 1-925-829-1851
>  Phone: 1-925-828-5892 (M-F, 9a-5p Pacific)
>  ---------------------------------------
>
>

Mon, Nov 19 2007 8:53 PMPermanent Link

"Terry Swiers"
RJ,

> And maybe that same setting can then also make trailing spaces disappear.

I surely hope not.

I agree with Tim that a zero length string is not the same as a NULL value
from the standpoint of the stored values, so I'm not here to argue that one
way or the other.  But from my application standpoint, an empty string and a
NULL value both translate to the same thing, nothing.   Since most of my UI
components and my print engine both use IS NULL to filter on blank string
fields, converting empty strings to NULL just makes everything work the same
way.  It also makes it much easier for my end users who are hand building
queries since they wouldn't have to check for both conditions.

But removing trailing spaces is actually changing the content of the data
where the trailing spaces may actually be valid data.  A zero length string
is not the same as a string value with 5 blank spaces in it and it is
definitely not equal to NULL.  I can see some value in this as it's own
separate option, but not as one option for two different actions.

--

---------------------------------------
 Terry Swiers
 Millennium Software, LLC
 http://www.1000years.com
 http://www.atrex.com

 Atrex Inventory Control/POS -
    Big business features without spending big business bucks!

Atrex Electronic Support Options:
 Atrex Knowledgebase: http://www.atrex.com/atrexkb.asp
 Email: mailto:support@atrex.com
 Newsgroup: news://news.1000years.com/millennium.atrex
 Fax: 1-925-829-1851
 Phone: 1-925-828-5892 (M-F, 9a-5p Pacific)
 ---------------------------------------



Tue, Nov 20 2007 3:44 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Terry

>But removing trailing spaces is actually changing the content of the data
>where the trailing spaces may actually be valid data. A zero length string
>is not the same as a string value with 5 blank spaces in it and it is
>definitely not equal to NULL. I can see some value in this as it's own
>separate option, but not as one option for two different actions.

My take is VARCHARS should be RTRIM'ed CHARS shouldn't

However I also believe that anyone allowing trailing spaces is out of their skull since there is no humanly sensible way to spot them.

Roy Lambert
Tue, Nov 20 2007 11:44 AMPermanent Link

"Terry Swiers"
Roy,

> However I also believe that anyone allowing trailing spaces is out of
> their skull since there is no humanly sensible way to spot them.

I've met some developers that are truely out of thier skull. Wink

Seriously, I have seen instances where the requirements for the data allowed
for trailing spaces to be valid data.  This wasn't necessarily humanly
readable data, so they didn't have to worry about the someone entering or
reading the data correctly.

--

---------------------------------------
 Terry Swiers
 Millennium Software, LLC
 http://www.1000years.com
 http://www.atrex.com

 Atrex Inventory Control/POS -
    Big business features without spending big business bucks!

Atrex Electronic Support Options:
 Atrex Knowledgebase: http://www.atrex.com/atrexkb.asp
 Email: mailto:support@atrex.com
 Newsgroup: news://news.1000years.com/millennium.atrex
 Fax: 1-925-829-1851
 Phone: 1-925-828-5892 (M-F, 9a-5p Pacific)
 ---------------------------------------


Tue, Nov 20 2007 12:55 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Terry


>I've met some developers that are truely out of thier skull. Wink

No surprises there then Smiley

>Seriously, I have seen instances where the requirements for the data allowed
>for trailing spaces to be valid data. This wasn't necessarily humanly
>readable data, so they didn't have to worry about the someone entering or
>reading the data correctly.

I remember quite a few years back now when one client had created an email address with spaces in the middle - two of them - rather difficult to spot from a business card.

I also remember a happy afternoon trying to figure out why a system wasn't issuing a warning when an address field was blank but was rather printing blank addresses on a mailshot.  Some kind sole had put in a single space - couldn't see this on screen or the letter. I think that day I pulled enough hair out to stuff a small sofa Smiley

Even when just a machine is reading it I'd prefer to put a visible character of some sort (even #8 - bell) than a trailing or leading space.

Roy Lambert
Tue, Nov 20 2007 1:58 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< So, basically the user of our software no longer has the option to make a
field NULL? >>

Not by making it blank.  You'll have to add the facilities for making it
NULL or modify your queries to look for NULLs or blank strings.

<< Yes, we are assuming that a string field cannot have value '', as this is
a conversion from a BDE app. >>

I understand.  However, SQL 2003 says that a VARCHAR or CHAR column value
can have the value '' and not be NULL, and ElevateDB is written to conform
to that standard.

--
Tim Young
Elevate Software
www.elevatesoft.com

« Previous PagePage 2 of 2
Jump to Page:  1 2
Image