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

Reboot Exadata Machine

ORA-01565: error in identifying file '?/dbs/spfile@.ora'

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