Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 18 total
Thread String field value ''
Sun, Nov 18 2007 2:12 PMPermanent Link

"Royke"
Is it possible for a string field to have value '' (= empty string) ? Is
that not automatically converted to Null, as (I think) the BDE does?

RJ

Mon, Nov 19 2007 2:34 AMPermanent Link

"Harry de Boer"
Royke,

Yes, that's possible. You can test it with EDBmngr easily. Just press F2 on
a field that has a NULL value in the grid, then press DELETE and voila.

Regards, Harry


"Royke" <royke@canada.com> schreef in bericht
news:FCAB3D5C-AC70-4777-A503-917F1A037150@news.elevatesoft.com...
> Is it possible for a string field to have value '' (= empty string) ? Is
> that not automatically converted to Null, as (I think) the BDE does?
>
> RJ
>
>

Mon, Nov 19 2007 3:45 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Royke


I disagree with Harry - I think the answer is no. NULL and an empty string are treated differently (much gnashing of teeth). You'll need to create triggers to set the field from '' to NULL.

Roy Lambert
Mon, Nov 19 2007 5:16 AMPermanent Link

"Harry de Boer"
Roy

> I disagree with Harry
Do you?  Wink

>NULL and an empty string are treated differently
Isn't that what I said?

Regards, Harry

"Roy Lambert" <roy.lambert@skynet.co.uk> schreef in bericht
news:FE2487C7-093A-4E0D-B4C3-365ACBA2DDB9@news.elevatesoft.com...
> Royke
>
>
> I disagree with Harry - I think the answer is no. NULL and an empty string
are treated differently (much gnashing of teeth). You'll need to create
triggers to set the field from '' to NULL.
>
> Roy Lambert
>

Mon, Nov 19 2007 6:24 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Harry


You're right. My interpretation of Royke's question was wrong.

Roy Lambert
Mon, Nov 19 2007 7:34 AMPermanent Link

"Harry de Boer"
Roy,

Glad you don't disagree with me anymore Smile

Harry

"Roy Lambert" <roy.lambert@skynet.co.uk> schreef in bericht
news:7A2BBCF4-A317-4392-8C7A-0454F05322BE@news.elevatesoft.com...
> Harry
>
>
> You're right. My interpretation of Royke's question was wrong.
>
> Roy Lambert
>

Mon, Nov 19 2007 10:56 AMPermanent Link

"Royke"
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?

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" ??

Royke

"Royke" <royke@canada.com> wrote in message
news:FCAB3D5C-AC70-4777-A503-917F1A037150@news.elevatesoft.com...
> Is it possible for a string field to have value '' (= empty string) ? Is
> that not automatically converted to Null, as (I think) the BDE does?
>
> RJ
>

Mon, Nov 19 2007 11:56 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Royke


What I'll be doing is creating a trigger to set any field that is '' to null - I think that will be easier overall and as far as I'm concerned the two mean the same anyway. And I DON'T CARE WHAT SQL2003 SAYS so there Smiley

I'm still hopeful that Tim will build something in to allow me to loop round the fields, test their type and if VARCHAR or CHAR do the necessary - for VARCHAR RTRIM them and for both if '' set to NULL. I've been busy TMS'ing an app but I'm finally (after months and months) getting to the point of EDB'ing it.

Roy Lambert
Mon, Nov 19 2007 12:00 PMPermanent Link

"Jose Eduardo Helminsky"
Roy

I think the best way to change standard behavior in the TXTable and/or
TXQuery, what ever value of X is inherit them and change POST method easily
according your needs. You need only to change a few portion of source code
and just re-compile your project.

Eduardo

Mon, Nov 19 2007 2:59 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@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

Page 1 of 2Next Page »
Jump to Page:  1 2
Image