Home arrow Oracle arrow Page 2 - SQL Script Support in Oracle 10G Express Edition

Sample scripts - Oracle

In an earlier tutorial we saw how to use SQL commands in the Oracle 10g Express Edition, or simply Oracle XE. We also saw how to use the PL/SQL commands as well. In another tutorial we saw how to use the Query Builder, the graphical interface for fashioning and running SQL in the Oracle XE. The present tutorial describes the SQL scripting support in Oracle XE. In order to bring out the basic features of scripting support a few example scripts are considered in the discussion.

TABLE OF CONTENTS:
  1. SQL Script Support in Oracle 10G Express Edition
  2. Sample scripts
  3. Creating a script
  4. Exporting and Importing of Scripts
By: Jayaram Krishnaswamy
Rating: starstarstarstarstar / 35
June 28, 2006

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

For the purpose of explaining the various activities you can perform in the script editor, some sample scripts will be considered. These are very simple scripts, but enough for the present purpose.

Selct

  Select * from First_Last;

Adval

  INSERT INTO first_last VALUES ('Jay', 'Krishnaswamy');

First_Last

create table first_last(
first_name CHAR(20),
last_name CHAR(20)
)
;

As you can see above, the script First_Last creates a table which is populated by the statement shown by the script Adval and the script Selct queries the table First_Last. This is a set of some very simple basic scripts.

Editing an existing script

In order to edit the script Selct, place a check mark in the extreme left as shown for this script, and click on the icon for "Edit" as shown in the next picture.

This opens up the Script Editor window as shown in the next picture. The script name you selected comes up and the script itself is displayed in the text editor as shown here. You may do a number of things in this text editor, such as undo, redo, and find text. For the script itself you can save, run, delete or download script from another location.

Let's hit the Run button now to get to the next window as shown. You will be asked to confirm in this window. This was a simple select query and running it will cause no changes. But there will be times when it is better to caution the user to confirm. You may also notice that the query is using the schema of HR.

Let's hit Run again. You get the window shown in the next picture. In this screen you manage the script results. It can show the status of the script, whether still executing, completed, and so on.

If you want to see the result of running this script, click on the "View Results" icon instead of the view script Icon as suggested in the above picture (it probably is an error). You will see the summary of results (default view) as shown in the next pciture.

To see the results of this query, you need to choose the View: Details radio button and hit the Go button as shown in the next picture.

Next, we will edit the script for Adval and change the first and last names to "James" and "Bond" so that the edited query will insert new values into the First_Last table. The Selct query is run again, and you will notice that you have added another row to the returned results as shown. Several steps are not shown because they are a repetition of the steps described earlier.

INSERT INTO first_last VALUES ('James', 'Bond');

When you run this Adval script you will see the following result.

Now if you run the Selct script again, you will see the following result.



 
 
>>> More Oracle Articles          >>> More By Jayaram Krishnaswamy
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

ORACLE ARTICLES

- Oracle Java Security Woes Continue
- Oracle's New IaaS Cloud Option: There's a Ca...
- Oracle Acquires Eloqua to Boost Cloud Presen...
- Choosing Innovation: Oracle Survey Insights
- Oracle Fixes Privilege Escalation Bug
- Oracle`s Communications Service Availability...
- Oracle Releases Exalytics, Taleo Plans
- Oracle Releases Communications Network Integ...
- Oracle Releases Communications Data Model 11...
- Oracle Releases PeopleSoft PeopleTools 8.52
- Oracle Integrates Cloudera Apache Distro, My...
- Oracle Releases MySQL 5.5.18
- Oracle Announces NoSQL Database Availability
- Sorting Database Columns With the SELECT Sta...
- Retrieving Table Data with the LIKE Operator

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: