Re: Using Cursors

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 01/25/05


Date: Tue, 25 Jan 2005 18:19:41 +0100

Galen,

> Actually, Oracle guidelines for a similar type operation are much
> different than SQLServer in that they highly recommend not to use the
> temp table solution, but instead, inline views and let Oracle decide
> how to do it. Works quite well in my experience. I rarely need the
> temp table solution when I code Oracle. So, not only do they
> recommend set based solutions, but they recommend it even more
> strongly than SQLServer.

Hmm, I'm surprised to see that "SQL Server recommends temp table solution". Where did you see that?
Often, you can use temp tables, table variables, views or quite simply incorporate the logic inside
one statement. If you have any MS documentation that recommends a temp table solution over set based
logic, I'd appreciate if you can post it here so we can let MS know about this.

-- 
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
<galenboyerdev@hotpop.com> wrote in message news:7jm132v1.fsf@hotpop.com...
> Hugo Kornelis <hugo@pe_NO_rFact.in_SPAM_fo> writes:
>
>> On Tue, 25 Jan 2005 08:31:22 -0500,
>> boyer@BOYER.i-did-not-set--mail-host-address--so-tickle-me wrote:
>>
>> (snip)
>>>> One thing I did learn from posts in thisd and other groups, is that
>>>> triggers in Oracle are executed once for each row affected. If this is
>>>> true
>>>
>>>This is not true. You can write many type of triggers in Oracle.
>>>
>>>   Row, Statement, Before, After, Instead of.
>>
>> Hi Galen,
>>
>> Ah! I (obviously) didn't know that. Thanks for the information.
>
> No prob.
>
>>
>> (snip)
>>>Set based coding is the norm in Oracle environments.  Cursors have
>>>their place, but all teachers of Oracle should say, first do it with
>>>sets.
>>
>> I think that the above statement holds for all serious databases.
>
> Actually, Oracle guidelines for a similar type operation are much
> different than SQLServer in that they highly recommend not to use the
> temp table solution, but instead, inline views and let Oracle decide
> how to do it.  Works quite well in my experience.  I rarely need the
> temp table solution when I code Oracle.  So, not only do they
> recommend set based solutions, but they recommend it even more
> strongly than SQLServer.
>
> -- 
> Galen Boyer 


Relevant Pages

  • Re: Using Cursors
    ... >> different than SQLServer in that they highly recommend not to use the ... >> temp table solution, but instead, inline views and let Oracle decide ... >> temp table solution when I code Oracle. ... >> strongly than SQLServer. ...
    (microsoft.public.sqlserver.programming)
  • Re: Using Cursors
    ... > Okay, let me rephrase it, every SQLServer shop I've been in and most ... > recommend against it, even if there are performance issues. ... I rarely see temp table solutions in msnews...programming group. ...
    (microsoft.public.sqlserver.programming)
  • Re: Using Cursors
    ... they involved too much memory and SQL server would crash. ... Using Oracle on the same machine, I have yet to run into a query that Oracle ... temp table approach doesn't scale very well; the DDL puts locks on the ... >> different than SQLServer in that they highly recommend not to use the ...
    (microsoft.public.sqlserver.programming)
  • Re: Need to Learn Oracle now
    ... > become proficient with Oracle as quickly as possible. ... > This group has been a great help, so I'm wondering if anyone recommend a ... The comp.databases.oracle.* hierarchy is quite active, ... If you mention that you are coming from a SQLServer ...
    (microsoft.public.sqlserver.programming)
  • Re: Using Cursors
    ... You can write many type of triggers in Oracle. ... different than SQLServer in that they highly recommend not to use the ... temp table solution when I code Oracle. ...
    (microsoft.public.sqlserver.programming)