SQL*Plus Notes:

SQL*Plus is an Oracle client -- a command-line application that allows the user to query and administer a database and its tables.

The user enters SQL (Structured Query Language) commands (or statements), the standard language for RDBMSes.

Different RDBMSes have different "flavors" or variations of standard SQL, but the basics are pretty much the same for all. MS Access even allows you to create queries in a "SQL View".

When entering commands and statements:

- extra white space is ignored
- statements may span multiple lines (by hitting Enter)
- the command is submitted only when it ends with a semi-colon, followed by hitting Enter
- statements are not case sensitive; case only matters when referring to field values in WHERE clauses.

In the lab:

- Launch the application from:

Start > All Programs > Oracle - OraClient11g_home1 > Application Development > SQL Plus

- Both your account User Name and Password are your full last name (use CAPITAL letters).

When logging in, use YOURUSERNAME@GISDB10 at the prompt to enter your username. (Example: TRUST@GISDB10)

You can copy text from Notepad (or any other document) and paste it into the SQL*Plus window. This is often recommended as a good way to practice (i.e., if the commands don't work the first time, you can edit, then copy and paste again, etc.).

You can copy what appears in the SQL*Plus window and paste it into Notepad or Word, etc. To copy, click on the upper left icon and choose Properties and check the box for QuickEdit Mode. (See Screen Shot). You will then be able to highlight text. Hit 'Enter' to copy it to the clipboard. Go to your text editor and Paste as you normally would (e.g., Ctrl-V or Edit > Paste). To paste text into the SQL*Plus window, copy it from Notepad or another text editor as you normally would (e.g., Ctrl-C or Edit > Copy), then go to SQL*Plus and right-click and the copied text will appear. (Without using QuickEdit Mode, you would have to click the upper left icon and choose Edit > Mark every time you wanted to copy and paste.)

There is no way to retrieve previous statements with the "up arrow" in this particular version of SQL*Plus, but you can resubmit the last statement by entering the forward slash ( / ) character. You can view your previous statement by entering the letter "L".

Sample commands:

describe mgisdata.towns_polym;

select town from mgisdata.towns_polym;

In SQL*Plus you can format output in various ways.
For example, you will see results 10 at a time. To override this, use the set pagesize command. Ex.:
set pagesize 100
will output 100 results at a time.
See http://www.ss64.com/orasyntax/plus_set.html for the SET command reference.