Create christmas tree in SQL*PLUS
                                                 Last update (2008-04-02 20:19:51)
                                                                                                                   Date added (2008-02-15 16:27:28)

Summary
Connect to sqlplus as sysdba
sqlplus>set heading off;

SELECT DECODE(SIGN(FLOOR(maxwidth/2)-ROWNUM), 1, LPAD( ' ', FLOOR(maxwidth/2)-(ROWNUM-1)) 
|| RPAD( '*', 2*(ROWNUM-1)+1, ' *'), LPAD( '* * *', FLOOR(maxwidth/2)+3)) "CHRISTMAS TREE"
FROM all_objects, (SELECT 40 AS maxwidth FROM DUAL) 
WHERE ROWNUM < FLOOR(maxwidth/2) + 5;
Reviews
Filters
Search