Giter Site home page Giter Site logo

oracle-fun's Introduction

Oracle Fun Stuff

Some simple scripts to have some fun while using Oracle Database in the SQL*Plus command line.

Who said you couldn't have fun with Oracle Database?

Note: Some messages, comments and variable names are in Brazilian Portuguese.

Installation

Set the SQLPATH environment variable to point to the scripts location or copy the scripts you want to the same folder you keep your custom scripts.

General help

  • Please, use the command @oracle-fun to display a list of commands in this package.
  • Scripts with colored output require a terminal that can handle ANSI escape sequences.
  • If output on some scripts are missing, truncated or messed up, please, try the following:
    • Adjust the terminal window dimensions (width, height)
    • Adjust the terminal window font family and size
    • Set a larger line size for script output on SQL*PLUS: SET LINESIZE 1000
    • Enable server output: SET SERVEROUTPUT ON SIZE UNLIMITED
    • Try setting some reasonable defaults for SQL*PLUS

Banner

  • @banner "Hello Oracle" - Prints a message in ASCII art
  • @bannerbg "Hello Oracle" - Prints a message in ASCII art with a big font
  • @bannerc "Hello Oracle" - Prints a message in ASCII art with a bigger font
SQL> @banner "Hello Oracle"
  _   _          _   _                ___                          _
 | | | |   ___  | | | |   ___        / _ \   _ __    __ _    ___  | |   ___
 | |_| |  / _ \ | | | |  / _ \      | | | | | '__|  / _` |  / __| | |  / _ \
 |  _  | |  __/ | | | | | (_) |     | |_| | | |    | (_| | | (__  | | |  __/
 |_| |_|  \___| |_| |_|  \___/       \___/  |_|     \__,_|  \___| |_|  \___|

Calendar

  • @cal_simp - Prints a simple calendar
  • @cal_color - Prints a calendar formatted as a table
  • @cal_tab - Prints a colored calendar

cal_color

Charts

  • All chart_XXX commands require that the label/group/category column be aliased as lbl and the value/numeric column must be aliased val.
  • You pass a simple one-line query as a parameter. The query should be delimited by double-quotation marks.

Horizontal Bar Chart

@chart_horiz "select 'Sample ' || lpad(rownum, 2, '0') as lbl, trunc(dbms_random.value(1, 1000)) as val from dual connect by level <= 15 order by 1"

chart_horiz

Vertical Bar Chart

@chart_bar "select '#' || lpad(rownum, 2, '0') as lbl, trunc(dbms_random.value(1, 1000)) as val from dual connect by level <= 15 order by 1"

chart_bar

3D Bar Chart

@chart_3d "select '#' || lpad(rownum, 2, '0') as lbl, trunc(dbms_random.value(1, 1000)) as val from dual connect by level <= 15 order by 1"

chart_3d

Colored Bar Chart

@chart_color "select '#' || lpad(rownum, 2, '0') as lbl, trunc(dbms_random.value(1, 1000)) as val from dual connect by level <= 15 order by 1"

chart_color

Donut/Pie Chart

@chart_donut "select chr(64 + rownum) as lbl, trunc(dbms_random.value(1, 1000)) as val from dual connect by level <= 9 order by 1"

chart_donut

Guitar

  • @guitar_fretboard - Prints a guitar fretboard
  • @guitar_note A - Prints a guitar fretboard showing all positions for a given note
  • @guitar_color A,B,C - Prints a guitar fretboard with notes in color

guitar_color

Miscellaneous

  • @ansi_colors - Print some helpful information on how to use ANSI escape sequences to have colored output on SQL scripts.
  • @brasil - Prints the Brazilian Flag in ASCII using an SQL query.
  • @gfx_gradient1, @gfx_gradient2, @gfx_gradient3 and @gfx_misc - Prints some graphical patterns
  • @xgh and @xgh_big - Prints a small and a big ASCII art logo for the Only Truly "Agile" Methodology that is used by everyone (even by Tesla).

misc

oracle-fun's People

Contributors

feliposz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.