Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Select from dual return 3 rows !
>De : oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] De la part de Eric Jenkinson
>
> Meta Link note 185438.1 Select * from DUAL - Delete from DUAL behaviour mentions
> that there is internalized code that ensures that a table scan of SYS.DUAL only returns one row.
You can still play a prank for April Fool's in your production database by DELETING the row in DUAL (unless you have Oracle 10, which even removes that possibility for mischief). In Oracle 9.2, a "select sysdate from dual" will return "no rows found" if dual has 0 rows. In Oracle 10.1, the "select sysdate from dual" will return one row with sysdate, but "select sysdate, dummy from dual" will return "no rows found" if dual has 0 rows.
SQL> connect sys as sysdba
Entrez le mot de passe :
Connecté.
SQL> select * from v$version ;
BANNER
SQL> delete from dual ;
1 ligne supprimée.
SQL> commit ;
Validation effectuée.
SQL> connect sys as sysdba
Enter password:
Connected.
SQL> select * from v$version ;
BANNER
SQL> delete from dual ;
1 row deleted.
SQL> commit ;
Commit complete.
SQL> connect jrk
Enter password:
Connected.
SQL> select sysdate from dual ;
SYSDATE
-- http://www.freelists.org/webpage/oracle-lReceived on Wed Nov 09 2005 - 19:05:14 CST
![]() |
![]() |