Home > How to use SQL*Plus in Oracle
Chapter Download:
EMAIL THIS

How to use SQL*Plus in Oracle

12 Mar 2009 | Written by: Joel Murach

Oracle tips, scripts, and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google

Murach's Oracle SQL and PL/SQL

Chapter 2, How to use Oracle SQL Developer and other tools

This chapter from Murach's Oracle SQL and PL/SQL explains how to work with Oracle SQL Developer and other tools. In this section, learn how to use SQL*Plus in Oracle, which may be used to run SQL statements and scripts if an Oracle database does not have an SQL Developer installation.

Table of contents:

[IMAGE] How to work with an Oracle database home page
[IMAGE] How to use SQL Plus in Oracle
[IMAGE] How to use SQL Developer to work with an Oracle database
[IMAGE] How to view and edit table column definitions
[IMAGE] How to use SQL Developer to run SQL statements
[IMAGE] How to use the Oracle Database SQL Reference manual

[IMAGE]

Figure 2-3 shows how to use a command-line tool known as SQL*Plus to work with the database. The SQL*Plus tool has been around since the earliest days of the Oracle database, and many Oracle developers still use it. However, the newer SQL Developer tool described later in this chapter is easier to learn and use than the SQL*Plus tool. That's why this chapter and the rest of this book shows how to work with the SQL Developer tool.

Still, there may be times when it makes sense to use SQL*Plus. If, for example, you are working on a computer that has SQL*Plus installed but doesn't have SQL Developer installed, you may need to us...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Oracle and SQL
Can I specify Oracle column order in my database table?
Review: Oracle's 11g R2 database has some good and bad
SELECT statement syntax and examples
Oracle PL/SQL tutorial
PL/SQL datatypes in Oracle
PL/SQL functions and triggers in Oracle
Stored procedures in PL/SQL
Do I need a license for SQL Developer Data Modeler in Oracle?
Using the SQL GROUP BY clause for counting combinations
How to use an SQL CASE expression
Oracle and SQL Research

Oracle DBA tools
Oracle delivers database fixes in Critical Patch Update
How to get the most out of Toad for Oracle 10
Q&A: Toad for Oracle 10 focuses on developer, DBA productivity
Review: Oracle's 11g R2 database has some good and bad
Oracle OpenWorld 2009 Special Report
Oracle releases new database, says 11g upgrade will cut costs
EnterpriseDB offers Oracle database users a 'bailout program'
Oracle raises prices on database management packs
How to use the Oracle Database SQL Reference Manual
How to use SQL Developer to run SQL statements

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
autonomous transaction  (SearchOracle.com)
CFML  (SearchOracle.com)
dynamic SQL  (SearchOracle.com)
foreign key  (SearchOracle.com)
Java Database Connectivity  (SearchOracle.com)
Open Database Connectivity  (SearchOracle.com)
Oracle  (SearchOracle.com)
stored procedure  (SearchOracle.com)
The Open Group  (SearchOracle.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


e SQL*Plus to run some SQL statements. Or, you may need to develop a batch file that uses SQL*Plus to run one or more SQL scripts. Figure A-5 of appendix A, for example, shows how to run a batch file that starts SQL*Plus and uses it to run four SQL scripts. In that case, of course, it makes sense to use SQL*Plus..

If you need to start SQL*Plus, you can do that by selecting the Run command from the Start menu, entering "sqlplus", and selecting the OK button. Then, you can connect to the database as a user by entering the username and password. In this figure, for example, I started by connecting as the AP user..

Once you're connected to the database, you can run SQL statements. To do that, you type the SQL statement followed by a semicolon and press the Enter key. Then, if the statement selects data, SQL*Plus will display the data. In this figure, for example, I entered a SQL statement that displays the vendor_name for the vendor with an id of 11..

At any time, you can connect to the database as a different user by entering the CONNECT command. When you enter this command, SQL*Plus prompts you for a username and password. In this figure, for example, I entered the CONNECT command to connect as the OM user.

The SQL*Plus tool

[IMAGE]

Figure 2-3 How to use SQL*Plus

Description

  • SQL*Plus is a command-line tool that's installed with the Oracle Database. You can use it to work with an Oracle Database.
  • To start SQL*Plus, select the Run command from the Start menu, enter "sqlplus", and select the OK button.
  • To connect to a database, enter the username and password. If necessary, you can enter the CONNECT command to have SQL*Plus prompt you for a username and password.
  • To run a SQL statement, type it, type a semicolon, and press the Enter key.
  • For most tasks, it's easier to use the SQL Developer tool that's described later in this chapter.

Download the chapter "How to use Oracle SQL Developer and other tools" in PDF form.

Continue to the next section: How to use SQL Developer to work with an Oracle database




Oracle Tutorials and Expert Advice
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts