Skip to Main Content
Oracle SQL*Plus: The Definitive Guide
book

Oracle SQL*Plus: The Definitive Guide

by Jonathan Gennick
March 1999
Intermediate to advanced content levelIntermediate to advanced
528 pages
14h 39m
English
O'Reilly Media, Inc.
Content preview from Oracle SQL*Plus: The Definitive Guide

Executing the Statement in the Buffer

Once you get a statement into the buffer and have edited it the way you want it, the next step is to execute that statement. That can be done with one of the following two methods:

  1. Type a forward slash on a line by itself, then press ENTER.

  2. Use the RUN command, which may be abbreviated to R.

The only difference between using RUN and / is that the RUN command lists the contents of the buffer before executing it, while the / command simply executes the command without relisting it. Assume that you have the SQL statement shown next in the buffer, which you will if you have followed through all the examples in this chapter.

SQL> L
  1    SELECT employee_name,  project_name
  2      FROM employee, project, project_hours
  3     WHERE employee.employee_id = project_hours.employee_id
  4     AND project_hours.project_id = project.project_id
  5*    GROUP BY employee_name, project_name

Here is how you would run it using the / command:

SQL> /

EMPLOYEE_NAME                            PROJECT_NAME
---------------------------------------- ----------------------------------
Bohdan Khmelnytsky                       Accounting System Implementation
Bohdan Khmelnytsky                       Corporate Web Site
Bohdan Khmelnytsky                       Data Warehouse Maintenance
Bohdan Khmelnytsky                       TCP/IP Implementation
Bohdan Khmelnytsky                       Year 2000 Fixes
...

Now, here is how you would execute it using the RUN command, which in the following example is abbreviated to R:

SQL> R 1 SELECT employee_name, project_name 2 FROM employee, project, project_hours 3 WHERE employee.employee_id = ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle SQL*Plus: The Definitive Guide, 2nd Edition

Oracle SQL*Plus: The Definitive Guide, 2nd Edition

Jonathan Gennick
Oracle PL/SQL Programming, Third Edition

Oracle PL/SQL Programming, Third Edition

Steven Feuerstein, Bill Pribyl
Oracle SQL

Oracle SQL

Dan Hotka

Publisher Resources

ISBN: 1565925785Supplemental ContentCatalog PageErrata