Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: A brief detour....;-)
I am just glad that so many on this read /. too ... that's my homepage ... on my Firebird browser.
Raj
-----Original Message-----
Bobak, Mark
Sent: Tuesday, December 09, 2003 12:54 AM
To: Multiple recipients of list ORACLE-L
Vladimir,
Nice solution! I had first briefly considered a SQL solution, but it didn't immediately come to mind, and the PL/SQL recursive solution was pretty straightforward, so, I went that direction. I wasn't really too concerned about expense, in this case....;-) I don't see too many practical applications. ;-)
-Mark
-----Original Message-----
From: Vladimir Begun [mailto:Vladimir.Begun_at_oracle.com] Sent: Mon 12/8/2003 8:19 PM To: Multiple recipients of list ORACLE-L Cc: Subject: Re: A brief detour....;-)
Interesting. PL/SQL recursive solutions are expensive, though. :) Did not check it, maybe something alike was posted already...
SET VERIFY OFF PAGES 200
DEFINE disks=7
REM Please do not use all_objects :)
DEFINE big_table=all_objects
COLUMN "Implementation Plan" FORMAT A20
SPOOL hanoi_solution.txt
SELECT 'Move it from '
|| TO_CHAR(MOD(BITAND(ROWNUM, ROWNUM - 1), 3) + 1) || ' to ' || TO_CHAR(MOD(-BITAND(-ROWNUM - 1, -ROWNUM), 3) + 1) AS "Implementation Plan"FROM &&big_table
Regards,
-- Vladimir Begun The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Vladimir Begun INET: Vladimir.Begun_at_oracle.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- 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). ************************************************************************************** This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you. **************************************************************************************5 -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jamadagni, Rajendra INET: Rajendra.Jamadagni_at_espn.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- 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 Dec 09 2003 - 07:04:24 CST