Running SQL Queries

Executing a SQL query or statement is as simple as typing it into the text box in the iSQL*Plus Workspace and pressing the Execute button. When executing a single SQL statement, you do not need to worry about terminating your statement with any special character such as the semicolon. For example, you can execute:

SELECT * FROM dual;

or you can execute:

SELECT * FROM dual

Any output from SQL statements that you execute will be displayed below the Execute button.

Paging Through Results

When a SQL statement brings back a large number of rows, iSQL*Plus displays results a page at a time. The number of rows displayed per "page" is determined by the PAGESIZE setting and defaults to 24. iSQL*Plus places a page break in between successive queries. Figure 3-8 shows two queries executed with one click of the Execute button. You can see that iSQL*Plus has displayed the result of the first query and has followed that result with a Next Page button. Click that button to see the next page with the result from the second query.

Paging through query results

Figure 3-8. Paging through query results

One thing worth noticing about Figure 3-8 is that the first of the two statements was terminated with a semicolon. When executing multiple SQL statements in one go, you must terminate all but the final one.

Tip

Use SET PAGESIZE n to specify a page size other than the default of 24 rows. Use SET PAGESIZE 0 to turn off pagination ...

Get Oracle SQL*Plus: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.