Board index » delphi » Using UpdateSQL for updating cached records

Using UpdateSQL for updating cached records

Hi,
I am using a query to retrieve a record and trying to update
it using the UpdateSql method .It seems it doesn't seem to work
Can someone show me how to do it !
Thanks in advance

Amitabh.

 

Re:Using UpdateSQL for updating cached records


Quote
In article <3352DC0D....@quote.com>, amitabh <amit...@quote.com> wrote:
>I am using a query to retrieve a record and trying to update
>it using the UpdateSql method .It seems it doesn't seem to work
>Can someone show me how to do it !
>Thanks in advance

If you've got a TQuery and a TUpdateSQL object, set the Query's
UpdateObject to the UpdateSQL object.  Double-click on the TUpdateSQL
component and go Generate SQL.

If you've gotten that far, some things to look for:

- You should have CachedUpdates on when you are using update-SQL.
- You have to TQuery.ApplyUpdates or you will lose the changes you made
  *grin*

  --=- Ritchie Annand

Re:Using UpdateSQL for updating cached records


Quote
R.Annand wrote:

> In article <3352DC0D....@quote.com>, amitabh <amit...@quote.com> wrote:
> >I am using a query to retrieve a record and trying to update
> >it using the UpdateSql method .It seems it doesn't seem to work
> >Can someone show me how to do it !
> >Thanks in advance

> If you've got a TQuery and a TUpdateSQL object, set the Query's
> UpdateObject to the UpdateSQL object.  Double-click on the TUpdateSQL
> component and go Generate SQL.

> If you've gotten that far, some things to look for:

> - You should have CachedUpdates on when you are using update-SQL.
> - You have to TQuery.ApplyUpdates or you will lose the changes you made
>   *grin*

>   --=- Ritchie Annand

You're missing the point. He's using TUpdateSQL to update a "long
varchar" field.
I quote from an e-mail by Joe Nodeland <joe_nodel...@sunshine.net>...

Quote
> This is a problem that keeps coming up and I have never seen an answer
> to it.  I contacted Borland on this and they did not have a good
> answer.  But Delphi 3 does allow you to use a memo field as a query
> parameter.  So the only option you have is to upgrade to D3 or use live
> queries.

I have scoured all possible resources and have come up with nothing.
This has been an infuriating and futile exercise!!! I don't know what we
are supposed to do ?????

Can anyone help?

Regards

Jonathan

Re:Using UpdateSQL for updating cached records


thats not the end of it either

Try inserting a few records and committing then deleteing a few and
commiting..

Then  check to see if the recordcount matches what you think it should

OOOOPs !!    Thank you for using Borland Software !

Jonathan Kimber <tps...@iafrica.com> wrote in article
<3354CEE3.5...@iafrica.com>...

Quote
> R.Annand wrote:

> > In article <3352DC0D....@quote.com>, amitabh <amit...@quote.com> wrote:
> > >I am using a query to retrieve a record and trying to update
> > >it using the UpdateSql method .It seems it doesn't seem to work
> > >Can someone show me how to do it !
> > >Thanks in advance

> > If you've got a TQuery and a TUpdateSQL object, set the Query's
> > UpdateObject to the UpdateSQL object.  Double-click on the TUpdateSQL
> > component and go Generate SQL.

> > If you've gotten that far, some things to look for:

> > - You should have CachedUpdates on when you are using update-SQL.
> > - You have to TQuery.ApplyUpdates or you will lose the changes you made
> >   *grin*

> >   --=- Ritchie Annand

> You're missing the point. He's using TUpdateSQL to update a "long
> varchar" field.
> I quote from an e-mail by Joe Nodeland <joe_nodel...@sunshine.net>...

> > This is a problem that keeps coming up and I have never seen an answer
> > to it.  I contacted Borland on this and they did not have a good
> > answer.  But Delphi 3 does allow you to use a memo field as a query
> > parameter.  So the only option you have is to upgrade to D3 or use live
> > queries.

> I have scoured all possible resources and have come up with nothing.
> This has been an infuriating and futile exercise!!! I don't know what we
> are supposed to do ?????

> Can anyone help?

> Regards

> Jonathan

Other Threads