Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Order by queries against INSERT statements from procedures
I have a temporary table filled with a statement like:
INSERT INTO TEMP_TABLE
SELECT A.ID, B.DATE_OPER, B.DATE_FIFO, B.AMOUNT T_AMOUNT FROM TABLE_A A, TABLE_B B WHERE A.ID = B.ID UNION ALL SELECT A.ID, C.DATE_OPER, C.DATE_FIFO, C.QUANTITY T_AMOUNT FROM TABLE_A A, TABLE_C C WHERE A.ID = C.ID; I query the temporary table by means of an "order by" statement: SELECT * FROM TEMP_TABLE ORDER BY DATE_OPER, DATE_FIFO;
The issue is this:
1.- Every time I run the INSERT statement directly from SQL*PLUS, the "order by" query returns always with the same sequence of ordered rows sharing the same DATE_OPER, DATE_FIFO values.
2.- If I have the INSERT statement within a procedure, each time I run the procedure, the "order by" query may return a different sequence of ordered rows sharing the same DATE_OPER, DATE_FIFO values.
Any idea about this behaviour?
-- http://www.freelists.org/webpage/oracle-lReceived on Fri Dec 10 2004 - 05:31:07 CST
![]() |
![]() |