Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: dual table - 9iR2
Believe it or not this behaviour is an artifact of the client you are
using to do the selects - sqlplus. For some strange reason I never
understood, SQL*Plus detects that you are selecting from dual, and only
processes the first row from the cursor each time. I think this is
bugged somewhere. It may be specific to the version of SQL*Plus as well
(from memory introduced with 9.0.1)
Oradba Linux wrote:
> I am curious about the behavior of dual table in oracle 9iR2 . It looks like
> when selecting from dual, implicitly where rownum=1 is added .
> I am just curious about how it works .
>
> Connected to:
> Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
> With the Partitioning and OLAP options
> JServer Release 9.2.0.4.0 - Production
>
> SQL> select count(*) from dual;
>
> COUNT(*)
> ----------
> 1
>
> SQL> select * from dual;
>
> D
> -
> X
>
> SQL> insert into dual values('Y');
>
> 1 row created.
>
> SQL> commit;
>
> Commit complete.
>
> SQL> select * from dual;
>
> D
> -
> X
>
> SQL> select count(*) from dual;
>
> COUNT(*)
> ----------
> 2
>
> SQL> set head off
> SQL> /
>
> 2
>
> SQL> select * from dual;
>
> X
>
> SQL> insert into dual values('Z');
>
> 1 row created.
>
> SQL> select * from dual;
>
> X
>
> SQL> commit;
>
> Commit complete.
>
> SQL> select count(*) from dual;
>
> 3
>
> SQL> select * from ( select * from dual) ;
>
> X
>
>
Received on Tue Sep 14 2004 - 21:38:54 CDT