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: james ellis <jellis24_gso_at_yahoo.com>
Date: Thu, 17 Aug 2000 06:00:46 -0700 (PDT)
Message-Id: <10592.114824@fatcity.com>


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. 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.

Received on Thu Aug 17 2000 - 08:00:46 CDT

Original text of this message

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