SQL Plus Worksheet and SQL Plus
An interesting tidbit of information to know about SQLPlus Worksheet is that it actually invokes the DOS-based SQL*Plus executable to do the real work.
When you type a command into the SQL*Plus Worksheet window, and click on the lightning-bolt button, SQLPlus Worksheet invokes SQL*Plus to execute that command. SQLPlus Worksheet is a Java application, and I suspect Oracle designed it this way in order to
avoid having to duplicate the existing SQL*Plus behavior in Java. A nice side-benefit is that you can be assured of 100%
compatibility between SQL*Plus and SQLPlus Worksheet. That's comforting if you run a lot of scripts.
Youcan also execute PL/SQL blocks via SQL*Plus, an interactive tool provided with all versions of Oracle.
PL/SQL program units can be precompiled.
Who Can Use SQL*Plus
The SQL*Plus, SQL, and PL/SQL command languages are powerful enough to serve the needs of users with some database experience, yet straightforward enough for new
users who are just learning to work with the Oracle Database. The SQL*Plus language is easy to use. For example, to rename a column labelled LAST_NAME with the heading "Family Name", enter the command:
COLUMN LAST_NAME HEADING 'Family Name'
Similarly, to list column definitions for the EMPLOYEES table, enter the command:
DESCRIBE EMPLOYEES
Accessing Oracle Database with SQL Developer
To run the SQL and PL/SQL commands to access Oracle Database, you can use SQL Developer.
All SQL and PL/SQL commands are supported as they are passed directly from the SQL Worksheet to the Oracle Database.
Set Up the JDK Path For SQL Developer
Set the following environmental variables to ensure that the correct jdk is picked up:
- $ORACLE_HOME
- $JAVA_HOME=$ORACLE_HOME/jdk
- $PATH=$JAVA_HOME/bin/:$PATH
To start SQL Developer on which the Java SDK release is installed, use the following commands:
- Change to $ORACLE_HOME/sqldeveloper.
- Run $ ./sqldeveloper.sh.
- Right-Click Connections. In the dialog box, enter a Connection name, username, password, and for the host string,
the name of the database to which you want to connect and click Connect.
Once connected, you can view, create, modify, and delete the database objects using the Connection Navigator or issue any
SQL or PL/SQL command using a SQL Worksheet (From the Tools menu, select SQL Worksheet).
SQL*Plus commands must be interpreted by the SQL Worksheet before being passed to the database.
The SQL Worksheet currently supports a number of SQL*Plus commands.
SQL*Plus commands which are not supported by the SQL Worksheet are ignored and are not sent to the Oracle Database.