iSelfSchooling.com - Copyright © 1999-2007 iSelfSchooling.com  References  Job Openings  |  Secure Login
    Home  | Search more...  |  FREE Online VIDEO Oracle Training  |  Gift Store  |  Bookstore

   Unlimited access!   

    Oracle  Syntax  | Suggestions Your Contribution  |  FREE Legal Forms

 

Email2aFriend Homepage us! |  Bookmark   -  Copyright & User Agreement

Products/Services

 Vision/Mission

 Community Sharing

 Services

  Products

 Biography

 Contact Us

 FAQ

 Current News

 Website Traffic

 Bookstore

 FREE Training

 SQL

 PL/SQL

 Forms 

 Reports

 Other TOOLS

 Fundamentals

 Performance

 OEM

 Application Server

 Grid Control

 Articles

 Prepare for OCP

Oracle SYNTAX

 Oracle Functions

 Oracle Syntax

 Oracle 10g Syntax

  PL/SQL Syntax

UNIX and more...

 UNIX for DBAs

 LINUX for DBAs

 DB using PHP

  A+ Certification

 Basics of JAVA  

 Tips of  SEO

Finance/Jobs

 Financial Aid

 Skilled

 Oracle

 Jobs

  Magazine

More Training

 Q & Answers

 SQL-PL/SQL

 DBA

 Developer

 Important Notes

 Case Studies

 9i New Features

 10g New Features

 10g Qs/As

 Grid Control

 OracleAS # I

 OracleAS # II

  LDAP and OID

  HTTP Server

 Instructor-Led

  Virtual Hosts

 Community Sharing

More to know...

Acknowledgement**

 FREE Legal Forms

 Who is who

 Market Place

 University Directory

 Advisory Articles

 Links...

 

 

Topics:  Hands-On 01 - Command Line Editing

 

Here you will learn how to use command line editor which it is native to SQL*PLUS.

You will use the following command.

 

    "L" command - Lists SQL or PL/SQL from the SQL buffer

    "I" command - Inserts SQL or PL/SQL lines

    “Del” command - Deletes SQL or PL/SQL lines

    "C" command - Changes SQL or PL/SQL lines

    SAVE command

    GET command

 

More Resources by Google:

 Manuscript

 

Go to MS-DOS and make a new directory to be used for your new scripts and programs.

 

Change directory to the root directory.

>>cd ..

 

Make a directory called "iself".

>> mkdir iself

 

Change the directory to the iself directory.

>> cd iself

 

List directory.  Notice that there is nothing in it.

>> dir

 

Login to “sqlplus” as "iself” password “schooling".

>> sqlplus iself/schooling

 

From now on the “iself” directory is a default directory for “SQLPLUS.”

 

Query the dept table.

>> select deptno, dname, loc from dept;

 

Always the last “sql” statement is in the Oracle buffer.

Type the letter "L" to list the last entered “SQL” statement.

>> l

 

The asterisk next to the line indicates the current line position.

 

Run the “SQL” statement in the buffer, using the "run" command.

>> run

 

or the letter "r."

>> r

 

or "/"

>> /

 

Write a format free “sql” statement to query the dept table; and enter each word in a line.

>>           select

        deptno,

        dname,

        loc

        from

        dept;

End the sql statement with “;” to terminate and execute the statement.

 

List the statement from the Oracle buffer.

>> L

 

Write a format free query and use a dot at the end of the sql statement to end the statement, but not run the statement..

The sql statement will be in the Oracle buffer as long as it was not replaced or the user session was not terminated.

>>          select

        deptno

        ,

        dname

        ,

        loc

        from

        dept

        .

 

Then run the statement.

>> r

 

Use the command line editor to add a column heading to the "loc" column.

Change the current line position to number 6 and then use the "C" or change command to add column heading.

>> L6

>> c/loc/loc "location"/

 

List the sql statement lines from 2 to 7.

>> L 2 7

 

List the entire query.

>> L

 

Delete the sql statement lines from 4 to 5.

>> del 4 5

 

Run the query.  Notice that the department name column was deleted.

>> /

 

Position line number 3 to the current line.

>> L3

 

Use the "i" or insert command to insert a line.

Then use the dot to terminate the insert mode.

>> i

4i dname,

.

 

List the query.  The line was added.

>> L

 

Then run the statement.

>> /

 

Save the sql statement as "d-e-p-t" file in the “iself” directory.

Notice that the default extension is “s-q-l.”

>> save dept

 

Use the "get" command to replace the sql file into the buffer.

>> get dept

 

Exit “sqlplus” to see where the file was stored?

>> exit

 

List the file names in the iself directory.

>> dir

 

Use the "type" command to list the query.

>> type dept.sql

 

Login to "sqlplus" as “iself/schooling”

>> sqlplus iself/schooling

List the buffer.

Notice that there is no query in the buffer.

Get the file and then run it.

 

>>l

 

>> get dept

          /

 

or use the "@" sign command to run the file.

>> @c:\iself\dept

 

Or use the "start" command to run the file.

>> start dept

 

These are different ways you can run the sql file.

 

Now, you should practice this over and over, until you become a master at it.

Good Luck!

 

 
 
Google
 
Web web site