Create christmas tree in SQL*PLUS

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;

Comments

Popular posts from this blog

Change Protection Mode for Active Dataguard (11GR2)

Reboot Exadata Machine

STEPS TO troubleshoot long running concurrent request in R12.2.x