Oracle database experiences

Oracle database blog

Plotting graph with SQL*Plus – Part II

Result

You will find below the result:

SQL> @plot_graph
     +.9 ****......................................................*********...........................................
     +.8 ....**..................................................**.........**.........................................
     +.7 ......*...............................................**.............*........................................
     +.6 .......**............................................*................**......................................
     +.5 .........*..........................................*...................*.....................................
     +.4 ..........*........................................*.....................*....................................
     +.3 ...........*......................................*.......................*...................................
     +.2 ............*....................................*.........................*..................................
     +.1 .............*..................................*...........................*.................................
     +.0 ..............**..............................**.............................**.............................**
     -.1 ................*............................*.................................*...........................*..
     -.2 .................*..........................*...................................*.........................*...
     -.3 ..................*........................*.....................................*.......................*....
     -.4 ...................*.....................**.......................................*.....................*.....
     -.5 ....................**..................*..........................................*...................*......
     -.6 ......................*................*............................................**................*.......
     -.7 .......................*.............**...............................................*.............**........
     -.8 ........................**.........**..................................................**.........**..........
     -.9 ..........................*********......................................................*********............

19 rows selected.

Remarks

  • The function to display is located at two positions (line 9 and 16). This repetition might be avoided in another implementation.
  • The query has been tested on Oracle 11gR2 and Oracle 12cR1.
  • The “plotting” characters could be replaced in line 2.
  • x-axis label is missing.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: