Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
Select from dual return 3 rows !

Select from dual return 3 rows !

2005-11-08       - By Rudy Zung

Reply:     1     2     3     4     5     6     7     8     9     10     >>  


Wow! I made DUAL work like a FIFO queue! Oracle's definitely done some fancy
dancing on DUAL in the recent versions (per Jared's comments that
single-row-only DUAL going back to 817.)

Logged in as SYS; select from DUAL, got 'X'.
Insert into DUAL values ('A'); select from DUAL, got 'X'.
Insert into DUAL values ('B'); select from DUAL, got 'X'.
Delete from DUAL; select from DUAL, got 'A'. (this is kind of creepy for me.)
Delete from DUAL; select from DUAL, got 'B'.
Delete from DUAL; select from DUAL, got nothing.
Fearing developers banging down the non-existent door of my cubicle if this
transaction got committed: rollback.
Select from DUAL, got back original 'X'.

This was on 10.1.0.2.

...Rudy



  -- --Original Message-- --
  From: Jared Still [mailto:jkstill@(protected)]
  Sent: Tuesday, November 08, 2005 3:46 PM
  To: Rudy Zung
  Cc: frank4oraclel@(protected); ORACLE-L;
frank.hansen@(protected)
  Subject: Re: Select from dual return 3 rows !
 
 
  On 11/8/05, Rudy Zung <Rudy.Zung@(protected)> wrote:
 

    DUAL, when you really come down to it, is really just a table
into which Oracle defaults with just a single record. However, because it is
just a simple table, additional records can be inserted into it, as you have
just discovered.
   


  That is version dependent.
 
  At least as far back as 8.1.7.4, there can
  be only one row in sys.dual.
 
  Try it.
 
 
  --
  Jared Still
  Certifiable Oracle DBA and Part Time Perl Evangelist
 


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff size=2>Wow!
I
made DUAL work like a FIFO queue! Oracle's definitely done some fancy dancing
on
DUAL in the recent versions (per Jared's comments that single-row-only DUAL
going back to 817.)</FONT></SPAN></DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff size=2
>Logged
in as SYS; select from DUAL, got 'X'.</FONT></SPAN></DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff size=2
>Insert
into DUAL values ('A'); select from DUAL, got 'X'.</FONT></SPAN></DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff size=2
>Insert
into DUAL values ('B'); select from DUAL, got 'X'.</FONT></SPAN></DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff size=2
>Delete
from DUAL; select from DUAL, got 'A'. (this is kind of creepy for
me.)</FONT></SPAN></DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff size=2
>Delete
from DUAL; select from DUAL, got 'B'.</FONT></SPAN></DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff size=2
>Delete
from DUAL; select from DUAL, got nothing.</FONT></SPAN></DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff
size=2>Fearing developers banging down the non-existent door of my cubicle if
this transaction got committed: rollback.</FONT></SPAN></DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff size=2
>Select
from DUAL, got back original 'X'.</FONT></SPAN></DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff size=2>This
was on 10.1.0.2.</FONT></SPAN></DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff
size=2>...Rudy</FONT></SPAN></DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=405250321-08112005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
 <DIV></DIV>
 <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
 face=Tahoma size=2>-- --Original Message-- --<BR><B>From:</B> Jared Still
 [mailto:jkstill@(protected)] <BR><B>Sent:</B> Tuesday, November 08, 2005 3:46
 PM<BR><B>To:</B> Rudy Zung<BR><B>Cc:</B> frank4oraclel@(protected); ORACLE-L;
 frank.hansen@(protected)<BR><B>Subject:</B> Re: Select from dual
 return 3 rows !<BR><BR></FONT></DIV>On 11/8/05, <B class=gmail_sendername
>Rudy
 Zung</B> &lt;<A href="mailto:Rudy.Zung@(protected)">Rudy.Zung@(protected)</A>&gt;
 wrote:
 <DIV><SPAN class=gmail_quote></SPAN>
 <BLOCKQUOTE class=gmail_quote
 style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204
,204) 1px solid">
   <DIV><SPAN><FONT face=Arial color=#0000ff size=2>DUAL, when you really come
   down to it, is really just a table into which Oracle defaults with just a
   single record. However, because it is just a simple table, additional
   records can be inserted into it, as you have just
   discovered.</FONT></SPAN></DIV>
   <DIV><SPAN><FONT face=Arial color=#0000ff
 size=2></FONT></SPAN>&nbsp;</DIV></BLOCKQUOTE></DIV><BR>That is version
 dependent.<BR><BR>At least as far back as <A
 href="http://8.1.7.4">8.1.7.4</A>, there can<BR>be only one row in
 sys.dual.<BR><BR>Try it.<BR><BR clear=all><BR>-- <BR>Jared
 Still<BR>Certifiable Oracle DBA and Part Time Perl
Evangelist<BR></BLOCKQUOTE></BODY></HTML>