Legal | Privacy





Getting Started with iSQL*Plus

In this lesson, you learn how to use the iSQL*Plus environment.

This lesson covers the following topics:

Overview
Prerequisites
Logging In
Executing Statements
Running Nested Scripts
Substitution Variables
Prompting for Values

Place the cursor on this icon to display all the screenshots in the lesson. You can also place the cursor on each individual icon in the following steps to see only the screenshot that is associated with that step.

iSQL*Plus is a browser-based implementation of SQL*Plus. You can use it to connect to an Oracle database system over the Internet to perform the same tasks as those that are performed through the SQL*Plus command line. The iSQL*Plus implementation uses a Web browser, an Oracle HTTP Server with the iSQL*Plus Server, and an Oracle database.

Architecture

iSQL*Plus User Interface

The iSQL*Plus user interface runs in a Web browser. There is no installation or configuration required for the iSQL*Plus user interface other than a Web browser.

iSQL*Plus Server

The iSQL*Plus Server runs as an Oracle Application Server Containers for J2EE (OC4J) application. The iSQL*Plus Server enables communication and authentication between the iSQL*Plus user interface and the RDBMS.

Oracle RDBMS

Oracle Net components provide communication between the iSQL*Plus Server and the Oracle RDBMS.

Before starting this lesson, you should have:

1.

Completed the Configuring Linux for the Installation of Oracle Database 10g lesson

 

2.

Completed the Installing Oracle Database 10g on Linux lesson

 

3.

Downloaded and unzipped isqlplus.zip to your working directory

 

4.

Opened a terminal window and executed the following commands:

mkdir - p $ORACLE_HOME/oc4j/j2ee/home/default-web-app/scripts/
cp ~/wkdir/ls_1.sql $ORACLE_HOME/oc4j/j2ee/home/default-web-app/scripts/
cp ~/wkdir/script1.sql $ORACLE_HOME/oc4j/j2ee/home/default-web-app/scripts/
cp ~/wkdir/script2.sql $ORACLE_HOME/oc4j/j2ee/home/default-web-app/scripts/
cp ~/wkdir/sub_var.sql $ORACLE_HOME/oc4j/j2ee/home/default-web-app/scripts/

Move your mouse over this icon to see the image

 

To log in, perform the following steps:

1.

Open your browser and enter the following URL:

http://<hostname>:5560/isqlplus

Enter hr as the username and hr as the password. Then click Login.

Move your mouse over this icon to see the image

 

Enter SQL statements and iSQL*Plus commands in the workspace as you would in command-line SQL*Plus. You can enter multiple commands at once.

1.

Type (or copy) the following commands in the workspace and click the Execute button.

SET PAGESIZE 200
DESCRIBE employees

SELECT first_name 
FROM   employees
WHERE  salary>1200;

SELECT * FROM employees;

 

2.

The results are displayed under the workspace. Click Clear.

Move your mouse over this icon to see the image

 

iSQL*Plus runs nested scripts over HTTP and FTP. In this example, script1.sql contains a request to run script2.sql.

script1.sql contains:

 PROMPT "This is the first script"
 SET PAGESIZE 200
 SELECT FIRST_NAME, LAST_NAME
 FROM EMP_DETAILS_VIEW
 WHERE SALARY > 12000
 ORDER BY LAST_NAME;
 @@script2.sql

script2.sql contains:

 PROMPT "This is the second script"
 SHOW USER
 SELECT LAST_NAME, SALARY
 FROM EMP_DETAILS_VIEW
 WHERE SALARY > 12000
 ORDER BY SALARY DESC;
1.

Load and execute script1.sql by entering the URL to the script in the iSQL*Plus workspace and clicking the Execute button. The syntax to load the script is:

@http://<hostname>:5560/scripts/script1.sql

Move your mouse over this icon to see the image

 

2.

script1.sql is executed and the results are displayed. Click Clear.

Move your mouse over this icon to see the image

 

iSQL*Plus prompts you for values for substitution variables in your scripts.

1.

Load sub_var.sql by entering the following URL and then clicking Execute.

@http://<hostname>:5560/scripts/sub_var.sql

Move your mouse over this icon to see the image

 

2.

The Input Required page appears. Enter employees, and then click the Continue button.

Move your mouse over this icon to see the image

 

3.

The script executes, and the results appear in the workspace. Click Clear.

Move your mouse over this icon to see the image

 

iSQL*Plus prompts for values, as it does for (&) substitution variables, for the:

  • ACCEPT command to request values for variables
  • RECOVER command to request the location of the log file (RECOVER command with SET AUTORECOVERY OFF)
  • PASSWORD command
  • CONNECT command where incomplete connection information is given

The following example uses an ACCEPT command. The same user interaction occurs for the other commands listed above.

1.

Enter the following commands and click Execute.

ACCEPT myvar NUMBER
DEFINE myvar

Move your mouse over this icon to see the image

 

2.

The Input Required page appears and waits for a value for the myvar variable. Enter 20, and then click the Continue button.

Move your mouse over this icon to see the image

 

3.

The results appear in the workspace.

Move your mouse over this icon to see the image

 

Place the cursor on this icon to hide all screenshots.

 

 

 

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy