Hi Bob

Thanks for the suggestion.

That is what I ended up doing.  I changed all of the tables with that
field to be varchar (5) instead of char (5).  I figured that the only
other thing that I could have done, was to zero fill the field value
when it is first generated and then back fill the current data.  Of
course with my end users they would have probably freaked out thinking
that different numbers were being created.

thanks

James 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Bob Swart
Sent: Sunday, August 05, 2007 2:56 AM
To: Moderated discussion list about database programming with Borland's
Delphi
Subject: Re: Delphi 6.0 / Client Data Set issue????

Hi James,

> When users are adding in data to my main table and to the linked
tables
> everything is fine.  When they then try to add in a record to child
> table the insert fails on the post event.  The key field is called
> "PROPOSAL_NB" and it is defined as char (5) on the server.

So on the server it is a field padded with spaces to make it exactly 5
long.

> failing.  The length of the data in the "PROPOSAL_NB" field in the
child
> table is 2.  The length of the data in the "PROPOSAL_NB" field in the
> parent table is 5.  I am thinking that because of the difference in
the
> data length the post is failing since the key fields do not match.  

That could be. I think that an UPDATE or INSERT query is generated, with

a WHERE clause and the key field of 2 characters specified in that WHERE

clause (where a key field of 5 characters is needed to find the actual 
parent)...

> Does anyone have any suggestions on how this can be resolved?

You could change the field on the server to be of type VARCHAR so no 
padding spaces are used. Or you could change the field to a numerical 
field like integer.

> James D. Stewart 

Groetjes,
           Bob Swart

-- 
Bob Swart Training & Consultancy (eBob42.com)  Forever Loyal to Delphi
Blog: http://www.drbob42.com/blog - RSS: http://drbob42.com/weblog.xml
Delphi 2006 Courseware PDF manuals at http://www.eBob42.com/courseware
_______________________________________________
Delphi-DB mailing list
[email protected]
http://www.elists.org/mailman/listinfo/delphi-db
_______________________________________________
Delphi-DB mailing list
[email protected]
http://www.elists.org/mailman/listinfo/delphi-db

Reply via email to