Board index » off-topic » Updating one field

Updating one field


2006-05-30 10:07:21 AM
off-topic7
I am using Delphi 7 and IB 7.5, with
IBQuery->DataSetProvider->ClientDataSet.
I want to change just one field of the DataSet,
but leave everything else unchanged. For the
query, I use 'SELECT "MyField" FROM MYTABLE'.
I change "MyField" and write back to the table.
"MyField" is not an indexed field.
The problem is that if I use UpWhereAll for
the update mode of the provider, it blanks out
all the other fields in the DataSet, and if I use
UpWhereChanged for the update mode, nothing
in the DataSet changes.
How can I change just this one field, but leave
everything else as it was before?
Thanks for any help on this!
 
 

Re:Updating one field

Something else is wrong. Changing one field in one record and calling
ApplyUpdates with upWhereAll works perfectly.
First, make sure that you have all of the updates and patches for D7
installed. Second, D7 shipped with a defective version of the IBX
components. Download the latest version for D7 from Jeff Overcash's
page on Code Central. IIRC the latest is 7.08.
Let us know if you still have the problem.
--
Bill Todd (TeamB)
 

Re:Updating one field

Never tried to retrieve only one field and update it. But how should the
provider find the correct record for the update in the DB ? I would
suggest that you retrieve atleast the keyfield(s) also.
Ralf
 

{smallsort}

Re:Updating one field

I misread your message. Ralf is correct, you must SELECT the primary
key. Without the primary key value(s) the DSP cannot build an UPDATE
statement with a WHERE clause that will update the correct record.
--
Bill Todd (TeamB)
 

Re:Updating one field

Thanks guys!
Works great now.
"Bill Todd" < XXXX@XXXXX.COM >wrote in message
Quote
I misread your message. Ralf is correct, you must SELECT the primary
key. Without the primary key value(s) the DSP cannot build an UPDATE
statement with a WHERE clause that will update the correct record.

--
Bill Todd (TeamB)