Subject | Re: [IBO] Bug or Newbie issue: DataSetProvider not updating properly |
---|---|
Author | Helen Borrie |
Post date | 2003-08-26T01:11:08Z |
At 08:29 PM 25/08/2003 +0000, you wrote:
statement automatically (as you do here). If it is False, the IBOQuery
just ignores the request to post.
The other way to get a live dataset in IBO is leave RequestLive false and
instead use the xxxxSQL properties to set up your own custom DML statements
to be used when Edit, Insert and Delete are called.
(Alternatively, you could use a TIBOUpdateSQL and hook it to the
UpdateObject property. That's extra, unneeded overhead in IBO - it's only
there for compatibility with converted BDE apps...)
true (which you don't need!!) AFAIK, this is how the
TClientDataset/Provider pair are meant to work.
But Unidirectional doesn't determine whether or not you have a cache. It
determines whether or not the dataset is buffered. iboquery (like tquery)
is by default buffered (scrollable). When Unidirectional true, the
iboquery behaves like the native tib_cursor and fetches rows one by one
into a single row buffer.
all...that would help to discover what (if any) problem needs solving.
Helen
>I do not know whether this is a bug in IBO or because I am so newYou're a good enough newbie that you found the SQL Monitor! :-))
>using IBO (acutally evaulating) that I am doing something wrong.
>IYou need this True if you want to depend on the query to create the update
>am connecting a TIBOQuery to a TDataSetProvider to a TClientDataSet.
>1. Open the TClientDataSet
>2. TClientDataSet.Edit and change the key value from XXX to WWW
>3. TClientDataSet.Post and TClientDataSet.ApplyUpdates(0)
>
>Problem: The DataSetProvider creates the following statement seem via
>TIB_Monitor:
>
>UPDATE SALESPERSON
> SET SALESPERSON_ID = ? /* SALESPERSON_ID */
> , NAME = ? /* NAME */
> , ISACTIVE = ? /* ISACTIVE */
> , GROUP_ID = ? /* GROUP_ID */
> , COMMISSION = ? /* COMMISSION */
>WHERE SALESPERSON.SALESPERSON_ID = ? /* OLD.SALESPERSON_ID */
>
>PARAMS = [ Version 1 SQLd 6 SQLn 6
> [SALESPERSON_ID] = 'XXX'
> [NAME] = 'Test Customer2'
> [ISACTIVE] = 'Y'
> [GROUP_ID] = 'YYY'
> [COMMISSION] = 0.15
> OLD.[SALESPERSON_ID] = 'XXX' ]
>
>Update suceeds, fails to process correctly, because the SALESPERSON_ID
>should be WWW instead of XXX, so SALESPERSON_ID has not changed. The
>only way that I can make this work is to change the following:
>
>TIBOQuery.RequestLive = True;
statement automatically (as you do here). If it is False, the IBOQuery
just ignores the request to post.
The other way to get a live dataset in IBO is leave RequestLive false and
instead use the xxxxSQL properties to set up your own custom DML statements
to be used when Edit, Insert and Delete are called.
(Alternatively, you could use a TIBOUpdateSQL and hook it to the
UpdateObject property. That's extra, unneeded overhead in IBO - it's only
there for compatibility with converted BDE apps...)
>TIBOQuery.Unidirectional = False;You won't have a cache for the iboquery unless you set CachedUpdates
>TDataSetProvider.ResolveToDataSet := True;
>
>But if I do this, I am using both the TIBOQuery and TClientDataSet to
>cache data (due to Unidirectional),
>so I know this can't be the
>correct procedure. Please Help.
true (which you don't need!!) AFAIK, this is how the
TClientDataset/Provider pair are meant to work.
But Unidirectional doesn't determine whether or not you have a cache. It
determines whether or not the dataset is buffered. iboquery (like tquery)
is by default buffered (scrollable). When Unidirectional true, the
iboquery behaves like the native tib_cursor and fetches rows one by one
into a single row buffer.
>I am using D7, Interbase 6.01 OS, IBO 4.2I guess what I'm curious about is why you are using TClientDataset at
all...that would help to discover what (if any) problem needs solving.
Helen