- •Contents
- •Send Us Your Comments
- •Preface
- •1 Introduction to iSQL*Plus
- •What is iSQL*Plus?
- •iSQL*Plus Architecture
- •iSQL*Plus User Interface
- •Oracle HTTP Server
- •Oracle9i
- •2 Configuring iSQL*Plus
- •System Requirements
- •Web Browser (client tier)
- •Oracle HTTP Server (middle tier)
- •Oracle9i (database tier)
- •Installation
- •Configuring the Client Tier
- •Adding MIME Types
- •Adding Proxy Server Exceptions
- •Configuring the Middle Tier
- •Configuring the iSQL*Plus Server
- •Defining a Connection Identifier
- •Setting the iSQL*Plus Session TimeOut
- •Changing the Default Cascading Style Sheet
- •Enabling or Disabling iSQL*Plus
- •Configuring the Oracle HTTP Server
- •Testing the Oracle HTTP Server Configuration File
- •Starting and Stopping the Oracle HTTP Server
- •Configuring the Database Tier
- •iSQL*Plus Security
- •Using Administration Privileges
- •Enabling User Security
- •Adding Entries to an Oracle HTTP Server Authentication File
- •Logging In Using Oracle HTTP Server Authentication
- •Security Usage Notes
- •Configuring Globalization Support
- •Web Browser - client tier:
- •Oracle HTTP Server - middle tier:
- •Oracle9i - database tier:
- •3 The iSQL*Plus User Interface
- •The iSQL*Plus Log In Screen
- •Help Icon
- •Username:
- •Password:
- •Connection Identifier:
- •Privilege:
- •Clear
- •The iSQL*Plus Work Screen
- •Password Icon
- •Log Out Icon
- •Help Icon
- •Enter statements:
- •Script location:
- •Browse...
- •Load Script
- •Execute:
- •Output:
- •Clear Screen
- •Save Script
- •The Change Password Screen
- •Help Icon
- •Username:
- •Old password:
- •New password:
- •Retype new password:
- •Change Password
- •Clear
- •Cancel
- •4 Using iSQL*Plus
- •Running iSQL*Plus
- •Entering Statements
- •Loading Scripts
- •Entering Substitution Variables
- •The Define Substitution Variables Screen
- •Password Icon
- •Log Out Icon
- •Help Icon
- •Define Substitution Variables
- •Submit for Execution
- •Cancel
- •Creating Dynamic Reports
- •Using SET and COLUMN Commands
- •Getting Help
- •Exiting iSQL*Plus
- •5 Command Reference
- •SQL*Plus Command Summary
- •@ (“at” sign)
- •@@ (double “at” sign)
- •/ (slash)
- •ARCHIVE LOG
- •ATTRIBUTE
- •BREAK
- •BTITLE
- •CLEAR
- •COLUMN
- •COMPUTE
- •CONNECT
- •COPY
- •DEFINE
- •DESCRIBE
- •DISCONNECT
- •EXECUTE
- •HELP
- •LIST
- •PROMPT
- •RECOVER
- •REMARK
- •REPFOOTER
- •REPHEADER
- •SHOW
- •SHUTDOWN
- •START
- •STARTUP
- •TIMING
- •TTITLE
- •UNDEFINE
- •VARIABLE
- •WHENEVER OSERROR
- •WHENEVER SQLERROR
- •SQL*Plus Error Messages and Codes
- •iSQL*Plus Error Messages
- •COPY Command Messages
- •PRODUCT_USER_PROFILE Table
- •Creating the PUP Table
- •PUP Table Structure
- •Description and Use of PUP Columns
- •PUP Table Administration
- •Disabling SQL*Plus, SQL, and PL/SQL Commands
- •Creating and Controlling Roles
- •Disabling SET ROLE
- •Disabling User Roles
- •Glossary
- •Index
Creating Dynamic Reports
Creating Dynamic Reports
You can create dynamic reports, and pass variables to scripts by sending iSQL*Plus a request to run a script from a Uniform Resource Identifier (URI). The script must be available through HTTP. iSQL*Plus executes the script, using any HTML form field values as parameters, and returns the results in a new browser window.
You will not be prompted for undefined variables. You should take care that there are no variables that have not been DEFINEd in your script, or explicitly passed as parameters.
You can also include username and password information in the request. You should carefully consider the security implications of including usernames and passwords in HTML files. If you do not include a username or password, iSQL*Plus prompts you to enter login information when you run the script.
Example 4–1 Creating a Dynamic Report
Create and save the following script to a file called script.sql on your Oracle HTTP Server.
SET PAGESIZE 200 SELECT *
FROM EMP_DETAILS_VIEW
ORDER BY LAST_NAME, EMPLOYEE_ID
/
Create an HTML file which contains:
<HTML>
<HEAD>
<TITLE>iSQL*Plus Dynamic Report</TITLE> </HEAD>
<BODY>
<H1>iSQL*Plus Report</H1>
<A HREF="http://host.domain/isqlplus?script=http://host.domain/script.sql"> Run Employee Report</A>
</BODY>
</HTML>
Replace host.domain with the host and domain names of your Oracle HTTP Server. Save the HTML file on your Oracle HTTP Server.
Load the HTML file in your web browser and click on "Run Employee Report". iSQL*Plus requests your username and password. Log in to iSQL*Plus. iSQL*Plus executes the script and displays the results in your web browser.
4-6 iSQL*Plus User’s Guide and Reference
Creating Dynamic Reports
Example 4–2 Creating a Dynamic Report with Parameters
Create and save the following script to a file called employee_name.sql on your Oracle HTTP Server.
SET VERIFY OFF
SET PAGESIZE 200
SET FEEDBACK OFF
SET MARKUP HTML ENTMAP OFF
PROMPT <H1>Employee Details for Employee(s) with Last Name like &last_name%</H1> SET MARKUP HTML ENTMAP ON
SELECT *
FROM EMPLOYEES
WHERE UPPER(last_name) LIKE UPPER(’&last_name%’)
/
Create an HTML file which contains:
<HTML>
<HEAD>
<TITLE>iSQL*Plus Dynamic Report</TITLE> </HEAD>
<BODY>
<H1>iSQL*Plus Report</H1> <H2>Query by Last Name</H2>
<FORM METHOD=get ACTION="http://host.domain/isqlplus">
<INPUT TYPE="hidden" NAME="script" VALUE="http://host.domain/employee_name.sql"> Enter last name of employee: <INPUT TYPE="text" NAME="last_name" SIZE="20"> <INPUT TYPE="submit" VALUE="Run Report">
</FORM>
</BODY>
</HTML>
The name of the INPUT TYPE should be the same as either a column or substitution variable in your script, for example
<INPUT TYPE="text" NAME="last_name" SIZE="20">
maps to the substitution variable &last_name in the employee_name.sql script.
Replace host.domain with the host and domain names of your Oracle HTTP Server. Save the HTML file on your Oracle HTTP Server.
Load the HTML file in your web browser. Enter a name or partial name in the text field, for example, "Fay". Click the Run Report button. iSQL*Plus executes the script and displays the results in your web browser.
Using iSQL*Plus 4-7
Creating Dynamic Reports
Example 4–3 Creating a Dynamic Script with Parameters and Login Details
Create and save the following script to a file called employee_id.sql on your Oracle HTTP Server.
SET VERIFY OFF
SET PAGESIZE 200
SET MARKUP HTML ENTMAP OFF
PROMPT <H1>Employee Details for Employee Number &eid</H1> SET MARKUP HTML ENTMAP ON
SELECT *
FROM EMPLOYEES
WHERE EMPLOYEE_ID = &eid
/
Create an HTML file which contains:
<HTML>
<HEAD>
<TITLE>iSQL*Plus Dynamic Report</TITLE> </HEAD>
<BODY>
<H1>iSQL*Plus Report</H1> <H2>Query by Employee ID</H2>
<FORM METHOD=get ACTION="http://host.domain/isqlplus">
<INPUT TYPE="hidden" NAME="userid" VALUE="hr/your_secret_password">
<INPUT TYPE="hidden" NAME="script" VALUE="http://host.domain/employee_id.sql"> Enter employee identification number: <INPUT TYPE="text" NAME="eid" SIZE="10"> <INPUT TYPE="submit" VALUE="Run Report">
</FORM>
</BODY>
</HTML>
Replace host.domain with the host and domain names of your Oracle HTTP Server, and hr/your_secret_password with a valid userid and password. Save the HTML file on your Oracle HTTP Server.
Load the HTML file in your web browser. Enter an employee identification number in the text field, for example, "105". Click the Run Report button. iSQL*Plus executes the script and displays the results in your web browser.
4-8 iSQL*Plus User’s Guide and Reference
Exiting iSQL*Plus
Using SET and COLUMN Commands
iSQL*Plus remembers the state of your current SET command variables from one execution to the next. If you use the Back button on your web browser and then re-execute scripts, iSQL*Plus may display the results differently, according to any commands executed since the original script was executed. For example, a new SET PAGESIZE command may set column headings to appear in different positions.
The COLUMN command, and the SET LINESIZE and SET WRAP commands have an effect on the buffer sizes used by iSQL*Plus. If words in your query output include unexpected white spaces or are truncated, make sure the column size is large enough to accommodate the word, and that word wrapping is set to ON.
Getting Help
The online iSQL*Plus User’s Guide and Reference provides help and syntax specific to iSQL*Plus. Click the Help button to access the iSQL*Plus User’s Guide and Reference. The iSQL*Plus User’s Guide and Reference is displayed in a new browser window.
Exiting iSQL*Plus
To exit iSQL*Plus, click the Log Out button. It is recommended that you always use the Log Out button to exit iSQL*Plus to free up system and server resources.
Using iSQL*Plus 4-9
Exiting iSQL*Plus
4-10 iSQL*Plus User’s Guide and Reference