Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: syntax - query's scalar results to a varible?

Re: syntax - query's scalar results to a varible?

From: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Tue, 04 Jul 2006 05:12:43 GMT
Message-Id: <pan.2006.07.04.05.12.43.107446@sbcglobal.net>


On Mon, 03 Jul 2006 14:21:14 -0700, matt wrote:

> im an application developer w/ a background in MS SQL Server, but i'm
> learning oracle pl/sql for a project. im learning quite a bit, but this
> one still gives me grief.
>
> in MS, when i needed to refer to a sub-query's result, i would often do
> something like this:

In Oracle, the type of variable that you want to return is ref cursor. You create a package, declare type "ref cursor" and have procedure return variables of that type. That is much more precise and defined then MS SQL which returns the result set implicitly. On the other hand, this is much more clumsy and cumbersome. Also, Oracle uses ref cursors instead of local temporary tables which, incidentally, aren't supported in Oracle. Global temporary tables are supported. The problem here is Oracle's centralized data dictionary. All things in data dictionary are global in scope. You cannot have per-session extension of the data dictionary which would properly handle such phantom things as local tables which would exist only for the duration of the session.

-- 
http://www.mgogala.com
Received on Tue Jul 04 2006 - 00:12:43 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US