Subject | Re: [firebird-support] FOR SELECT... CURSOR? |
---|---|
Author | Martijn Tonies |
Post date | 2006-03-03T15:16:47Z |
Hi,
IMO, choose what you will be able to maintain and read.
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> I have just a little question...table
> Is there a considerable difference between these two ways to update a
> in a stored proc?The second one will be slightly faster.
>
> 1)
> FOR
> SELECT APrimaryKeyField
> FROM ATable
> WHERE SomeCondition
> INTO :AVariable
> DO
> BEGIN
> /* Some Stuff... */
> UPDATE ATable
> SET SomeField = SomeValue
> WHERE APrimaryKeyField = :AVariable;
> END
>
> 2)
> FOR
> SELECT Whatever
> FROM ATable
> WHERE SomeCondition
> INTO :SomeDummyVar
> AS CURSOR SomeCursor
> DO
> BEGIN
> /* Some Stuff... */
> UPDATE ATable
> SET SomeField = SomeValue
> WHERE CURRENT OF SomeCursor
> END
>
> At first glance I'd have thought the second way is the best, but I wonder
> what the group's opinion is...
IMO, choose what you will be able to maintain and read.
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com