Re: COALESCE does short circuit - NOT

From: Maxim <mdemenko_at_gmail.com>
Date: Thu, 19 Jan 2012 17:37:24 +0100
Message-ID: <CAFP4yMwgov8EB0GpajMFKj08aYCa00iHf4dXPEJj0bJn=Sg_DQ_at_mail.gmail.com>



Uwe, i think, it simply works this way. It doesn't matter, should it be short circuited or not, single reference in the select is sufficient for oracle to increment the sequence (once per row in the resultset) - it can be as well interpreted this way from documentation: http://docs.oracle.com/cd/E11882_01/server.112/e26088/pseudocolumns002.htm#SQLRF50946

Within a single SQL statement containing a reference to NEXTVAL, Oracle increments the sequence once:

For each row returned by the outer query block of a SELECT statement. Such a query block can appear in the following places:

   -

   A top-level SELECT statement

The same effect you can observe in dead leafs of case statement (e.g. case when 1=2 then seq.nextval -- will be incremented as well)

Best regards

Maxim

2012/1/19 "Uwe Küchler" <uwe_at_kuechler.org>

> Hi Folks,
>
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jan 19 2012 - 10:37:24 CST

Original text of this message