Subject | RE: [IBO] For UPDATE clause? |
---|---|
Author | Alan McDonald |
Post date | 2002-12-10T06:44:59Z |
Thanks again Jason,
If I'm reading your right, then, IBO does it all better for me anyway,
there's no need to use FOR UPDATE, so I can forget about how to use it?
Alan
-----Original Message-----
From: Jason Wharton [mailto:jwharton@...]
Sent: Tuesday, 10 December 2002 4:37 PM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] For UPDATE clause?
Yes, the perspective I gave was the server perspective and the raw SQL text
sent to it. In a buffered query I use the FOR UPDATE clause to indicate you
want a live buffer but there is an additional setting the tells whether IBO
should post updates using searched or positioned updates. The properties are
called SearchedEdits and SearchedDeletes.
I also use it to allow you to tell which columns editing is allowed with.
But, if you notice, with all buffered queries I will strip off the FOR
UPDATE clause that is sent to the server. This is because with a buffered
dataset there really is no respect to the cursor position on the server and
whatever record the user has the record pointer on in the buffer. All
records coming into a buffered dataset I want fetched in the most efficient
way possible so by striping off the FOR UPDATE clause it allows multiple
records to be batched together into a single network hit.
If you stop and think about it for a minute, you would realize that with a
buffered query that a positioned (cursor) update is really not so smart.
Reason is because you would have to open a cursor with a query to search for
the record to do the positioned update on. You just as well do a searched
update in that case.
Regards,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
-- We may not have it all together --
-- But together we have it all --
If I'm reading your right, then, IBO does it all better for me anyway,
there's no need to use FOR UPDATE, so I can forget about how to use it?
Alan
-----Original Message-----
From: Jason Wharton [mailto:jwharton@...]
Sent: Tuesday, 10 December 2002 4:37 PM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] For UPDATE clause?
Yes, the perspective I gave was the server perspective and the raw SQL text
sent to it. In a buffered query I use the FOR UPDATE clause to indicate you
want a live buffer but there is an additional setting the tells whether IBO
should post updates using searched or positioned updates. The properties are
called SearchedEdits and SearchedDeletes.
I also use it to allow you to tell which columns editing is allowed with.
But, if you notice, with all buffered queries I will strip off the FOR
UPDATE clause that is sent to the server. This is because with a buffered
dataset there really is no respect to the cursor position on the server and
whatever record the user has the record pointer on in the buffer. All
records coming into a buffered dataset I want fetched in the most efficient
way possible so by striping off the FOR UPDATE clause it allows multiple
records to be batched together into a single network hit.
If you stop and think about it for a minute, you would realize that with a
buffered query that a positioned (cursor) update is really not so smart.
Reason is because you would have to open a cursor with a query to search for
the record to do the positioned update on. You just as well do a searched
update in that case.
Regards,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
-- We may not have it all together --
-- But together we have it all --
----- Original Message -----
From: "Alan McDonald" <alan@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, December 09, 2002 7:18 PM
Subject: RE: [IBO] For UPDATE clause?
> Thanks Jason,
> If this clause, then, is added to the SQL property of an IB_Query
component,
> does the component use this method of update? The generated SQL for update
> for the query does not imply this method as being used. Or is there
another
> setting for utilising this method of update?
> Alan
>
> -----Original Message-----
> From: Jason Wharton [mailto:jwharton@...]
> Sent: Tuesday, 10 December 2002 3:55 AM
> To: IBObjects@yahoogroups.com
> Subject: Re: [IBO] For UPDATE clause?
>
>
> This is how you tell InterBase to maintain a live cursor such that it will
> increment a pointer on the server one record at a time instead of batching
> records together into packets for efficiency. Because the server is
> maintaining a record pointer to the row just fetched it gives you the
> opportunity to perform an update statement like this:
>
> UPDATE atable
> SET acol = aval
> WHERE CURRENT OF acursorname
>
> This eliminates the need to have a searched record but instead it goes
> immediately and directly to the current record pointer and performs the
> update.
>
> Jason Wharton
> CPS - Mesa AZ
> http://www.ibobjects.com
>
> -- We may not have it all together --
> -- But together we have it all --
>
>
> ----- Original Message -----
> From: "Alan McDonald" <alan@...>
> To: <IBObjects@yahoogroups.com>
> Sent: Sunday, December 08, 2002 4:59 AM
> Subject: [IBO] For UPDATE clause?
>
>
> > I see occasionally the clause "FOR UPDATE" in the SQL box. Must ahve
> missed
> > reading the explanation for it. Can someone enlighten me?
> > Alan
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/