I am just glad that so many on this read /. too ... that's my homepage ... on my 
Firebird browser.

Raj
--------------------------------------------------------------------------------
Rajendra dot Jamadagni at nospamespn dot com
All Views expressed in this email are strictly personal.
QOTD: Any clod can have facts, having an opinion is an art !


-----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:[EMAIL PROTECTED]
Sent:   Mon 12/8/2003 8:19 PM
To:     Multiple recipients of list ORACLE-L
Cc:     
Subject:        Re: A brief detour....;-)
Bobak, Mark wrote:
 > Here it is:
[...]
 > This concludes this public service announcement.  We now return
 > you to our regularly scheduled programming.

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
  WHERE ROWNUM < POWER(2, &&disks)
    AND &&disks < 8
/
SPOOL OFF

Should work correctly.

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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to