Re: Can a procedure contain only a SELECT statement?

From: John Hurley <hurleyjohnb_at_yahoo.com>
Date: Fri, 19 Mar 2010 02:40:47 -0700 (PDT)
Message-ID: <d72eefd4-4bf0-4827-9af8-5a2395af4d7d_at_g28g2000yqh.googlegroups.com>



On Mar 18, 10:33 pm, Thomas Gagne <TandGandGA..._at_gmail.com> wrote:

snip

> I've used it before in other RDBs.  The example was deliberately
> simplified.  My intent would be to allow more complicated processing
> before the final SELECT.  In some cases the procedure could do some
> simple parameter checking, call other procedures, and preprocess into
> temporary tables before the final projection.  Though I haven't had the
> need inside MySQL, I understand MySQL has provided this since 5.1.

You rarely and really want to stay away from using temporary tables when processing work in Oracle.

Really this is a technique that for the most part can be avoided in almost any relational dbms.

Using temporary tables kinda/sorta looks like a crutch for most experienced DBAs and developers. Do it all in 1 SQL statement and harness the power of the database engine. Give it as much work as you can in 1 SQL statement! Received on Fri Mar 19 2010 - 04:40:47 CDT

Original text of this message