Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 15 of 15 total
Thread VARCHARS and truncation
Tue, Jan 29 2008 4:02 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


>I'm not sure what you mean by "validate the length" ? Do you mean check for
>trailing blanks ? Remember, trailing blanks are not considered when doing
>VARCHAR/CHAR comparisons.

Nope not the trailing blanks, if I have a varchar(5) I have to make sure that I never attempt to assign 6 characters to it.

>Because the language/compiler that we use only has the ability to raise
>exceptions, not warnings. Warnings and errors both surface via exceptions
>in EDB, just like they did with DBISAM.

Interesting, I learn something new every day.

><< BTW if you continue with raising the error your message is totally wrong.
>The value was not truncated, the insert or update was aborted/ignored >>
>
>I'm not sure what you're talking about here - are you specifically referring
>to the mechanics of the OnPostError, etc. type of functionality ?

No its just that your error message says that the data was truncated and its not, the entire operation is abandoned. If inserting the record is never posted. I can just see some poor misguided user trying to find the record they've just entered to see what was truncated to what and never being able to find it.

Maybe something like "Due to the fact that the data being applied to column xx is to long this operation has been terminated with extreme prejudice"

Possibly a bit shorter Smiley

Roy Lambert
Tue, Jan 29 2008 4:07 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim



>There's nothing I can do about this.

Hooray woopee etc.

Since most of my data entry will go this way I've cracked it. Now I just have to hope CodeGear don't change anything.

Is there a list anywhere that you know of showing the differences in the way Pascal (Delphi) and SQL treat data. This one and NULL's are the ones I've spotted so far but it would be nice to get some pre-warning of the clashes.

Roy Lambert
Tue, Jan 29 2008 3:56 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< No its just that your error message says that the data was truncated and
its not, the entire operation is abandoned. If inserting the record is never
posted. I can just see some poor misguided user trying to find the record
they've just entered to see what was truncated to what and never being able
to find it. >>

Ahh, I see what you're saying.  I'll see if I can spruce that up a bit.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Jan 29 2008 3:57 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Is there a list anywhere that you know of showing the differences in the
way Pascal (Delphi) and SQL treat data. This one and NULL's are the ones
I've spotted so far but it would be nice to get some pre-warning of the
clashes. >>

The two major issues are the NULLs and the truncation.   I can't think of
any other issue other than your typical formatting issues for display, etc.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Jan 30 2008 4:08 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


Minor issues often sneak round and bite you in the bum!

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