Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Creating sequences on the DUAL table?

RE: Creating sequences on the DUAL table?

From: <Cherie_Machler_at_gelco.com>
Date: Tue, 30 Jul 2002 11:24:51 -0800
Message-ID: <F001.004A6578.20020730112451@fatcity.com>

Kevin,

Thanks for the suggestion on select statements. I will pass them on. I think it's just a misunderstanding on his part as to where the sequences are actually created. Apparently he only uses them in a select from dual so he thinks they reside there.

Cherie

                                                                                                                 
                    "kkennedy"                                                                                   
                    <kkennedy_at_first       To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>    
                    point.com>            cc:                                                                    
                    Sent by:              Subject:     RE: Creating sequences on the DUAL table?                 
                    root_at_fatcity.co                                                                              
                    m                                                                                            
                                                                                                                 
                                                                                                                 
                    07/30/02 01:28                                                                               
                    PM                                                                                           
                    Please respond                                                                               
                    to ORACLE-L                                                                                  
                                                                                                                 
                                                                                                                 




Hmmmm? Sequences are not created "on" the dual table. Sequences exist as independent entities. Ofttimes, sequence values are selected using the dual table (e.g., select seqname.nextval from dual) -- this is a coding choice. Performance of queries that select from the dual table are generally not "inviting poor performance" (although I've seen some postings on how to improve their performance).

If I were you, I would do some more reading up on sequences in the Concepts manual and not worry too much about the performance. Suggest to the developers that they use the sequences directly whenever possible rather than selecting from dual as in the following:

One method:
select seqname.nextval into local_var from dual; insert into destination_table (...id_column...) values (...local_var...);

Better method:
insert into destination_table (...id_column...) values (...seqname.nextval...);

And, if the value is needed for other things: insert into destination_table (...id_column...) values (...seqname.nextval...)

   returning id_column into local_var;

HTH
Kevin Kennedy
First Point Energy Corporation

If you take RAC out of Oracle you get OLE! What can this mean?

-----Original Message-----

Sent: Tuesday, July 30, 2002 10:54 AM
To: Multiple recipients of list ORACLE-L

I have a request from one of our developers to create two new sequences on the DUAL table.

This seems like a bad idea to me. I've never had such a request in the past. I asked for clarification on why this is needed and I didn't get a lot of details yet.

Is this something that is standard operating procedure? My understanding that interfacing with the DUAL table is usually inviting poor performance. Plus, I don't like to mess around with system tables, in general.

Under what circumstances would it be justified to create sequences on the DUAL table? Should I just flat-out refuse this request and if so, why?

Thanks,

Cherie Machler
Oracle DBA
Gelco Information Network

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: Cherie_Machler_at_gelco.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: kkennedy
  INET: kkennedy_at_firstpoint.com
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: Cherie_Machler_at_gelco.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Tue Jul 30 2002 - 14:24:51 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US