Re: Question about Queries

From: Tim X <timx_at_nospam.dev.null>
Date: Fri, 26 Dec 2008 14:26:13 +1100
Message-ID: <87bpuzpqga.fsf@lion.rapttech.com.au>


William Robertson <williamr2019_at_googlemail.com> writes:

> On Dec 24, 9:30 pm, Mladen Gogala <mgog..._at_yahoo.com> wrote:
>> >Second, is using EXECUTE IMMEDIATE for doing a SELECT faster than a
>> >normal coded SELECT?
>
> I must admit I could never see the sense of the "IMMEDIATE" keyword
> here. Perhaps the standard allows for some "DEFERRED" option for
> background submission, that no vendor currently supports? Otherwise
> you'd think EXECUTE STATEMENT would have made rather more sense. Then
> again anything is possible from the geniuses who came up with LEFT and
> RIGHT alternatives for join syntax.
>

Granted that its probably not the best terminology, but since you already have execute in sqlplus which simply wraps some plsql in a begin/end block, the rationale was probably just to avoid confusion with that command. The 'immediate' sort of makes sense if you think of it as a command to execute dynamic code that isn't known at plsql compile time like other statements - so its more immediate than the code which was already known at compile time. Its also a bit more lightweight than using the dynamic sql facilities provided in the built-in plsql packages, which at a stretch could also be considered less immediate because you have more 'housekeeping' to take care of..

Tim

-- 
tcross (at) rapttech dot com dot au
Received on Thu Dec 25 2008 - 21:26:13 CST

Original text of this message