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: PL/SQL Ordered Insert

Re: PL/SQL Ordered Insert

From: William Beilstein <BeilstWH_at_obg.com>
Date: Thu, 17 Aug 2000 11:33:04 -0400
Message-Id: <10592.114854@fatcity.com>


Oracle doesn't specify an order when it stores rows. If you want the data = returned in a specific order, user the ORDER clause on the cursor select = that you will use to access the temp table.

>>> james ellis <jellis24_gso_at_yahoo.com> 08/17/00 10:04AM >>> I am the original DBA that this post was for. You are correct you can not have an order by clause in an insert/select statement. The reason the data needs to be ordered is to ensure that it is retrieved in the same order everytime this procedure is executed. The data in the table is temporary. It will be deleted at the end of the execution so everytime there will be new data inserted by sessionid to ensure when it is selected out the user who inserted it gets only his/her rows back. The reason for the ordering is because a position is passed into the procedure which tells the procedure to retrieve back only row number 2 or 3 and this will stay constant if the data is inserted in the same order every time. I hope this sheds some light on the situation. I think I am going to use the cursor concept to accomplish this goal.=20 Which if I do it this way there is no need for a temp table. I can just pick the record out of the loop when the counter reaches the position that was passed in. Thanks for the ideas.


Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/=20
--=20
Author: james ellis
  INET: jellis24_gso_at_yahoo.com=20
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 Received on Thu Aug 17 2000 - 10:33:04 CDT

Original text of this message

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