Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
30
Добавлен:
16.04.2013
Размер:
2.15 Mб
Скачать

DISCONNECT

DISCONNECT

Syntax

DISC[ONNECT]

Commits pending changes to the database and logs the current username out of Oracle, but does not exit SQL*Plus.

Usage

Use DISCONNECT within a command file to prevent user access to the database when you want to log the user out of Oracle but have the user remain in SQL*Plus. Use EXIT or QUIT to log out of Oracle and return control to your host computer’s operating system.

Examples

Your command file might begin with a CONNECT command and end with a DISCONNECT, as shown below.

CONNECT HR/HR

SELECT LAST_NAME, DEPARTMENT_NAME FROM EMP_DETAILS_VIEW;

DISCONNECT

SET INSTANCE FIN2

CONNECT HR2/HR2

5-54 iSQL*Plus User’s Guide and Reference

EXECUTE

EXECUTE

Syntax

EXEC[UTE] statement

Executes a single PL/SQL statement. The EXECUTE command is often useful when you want to execute a PL/SQL statement that references a stored procedure. For more information on PL/SQL, see your PL/SQL User’s Guide and Reference.

Terms

Refer to the following for a description of the term or clause:

statement

Represents a PL/SQL statement.

Usage

If your EXECUTE command cannot fit on one line because of the PL/SQL statement, use the SQL*Plus continuation character (a hyphen).

The length of the command and the PL/SQL statement cannot exceed the length defined by SET LINESIZE.

Examples

If the variable :n has been defined with:

VARIABLE n NUMBER

The following EXECUTE command assigns a value to the bind variable n:

EXECUTE :n := 1

PL/SQL procedure successfully completed.

For information on how to create a bind variable, see the VARIABLE command in this chapter.

Command Reference 5-55

HELP

HELP

Syntax

HELP [topic]

Accesses the SQL*Plus help system. Enter HELP INDEX for a list of topics.

Terms

Refer to the following for a description of the term or clause:

topic

Represents a SQL*Plus help topic, for example, COLUMN.

Enter HELP without topic to get help on the help system.

Usage

You can only enter one topic after HELP. You can abbreviate the topic (for example, COL for COLUMN). However, if you enter only an abbreviated topic and the abbreviation is ambiguous, SQL*Plus displays help for all topics that match the abbreviation. For example, if you enter

HELP EX

SQL*Plus displays the syntax for the EXECUTE command followed by the syntax for the EXIT command.

If you get a response indicating that help is not available, consult your database administrator.

Examples

To see a list of SQL*Plus commands for which help is available, enter

HELP INDEX

Alternatively, to see a single column display of SQL*Plus commands for which help is available, enter

HELP TOPICS

5-56 iSQL*Plus User’s Guide and Reference

LIST

LIST

Syntax

L[IST] [n|n m|n *|n LAST|*|* n|* LAST|LAST]

Lists one or more lines of the SQL buffer.

Terms

Refer to the following list for a description of each term or clause:

n

Lists line n.

n m

Lists lines n through m.

n *

Lists line n through the current line.

n LAST

Lists line n through the last line.

*

Lists the current line.

* n

Lists the current line through line n.

* LAST

Lists the current line through the last line.

LAST

Lists the last line.

Enter LIST with no clauses to list all lines. The last line or only line listed becomes the new current line (marked by an asterisk).

Examples

To list the contents of the buffer, enter

LIST

You will see a listing of all lines in the buffer, similar to the following example:

1SELECT LAST_NAME, DEPARTMENT_ID, JOB_ID

2FROM EMP_DETAILS_VIEW

3WHERE JOB_ID = ’SH_CLERK’

4* ORDER BY DEPARTMENT_ID

The asterisk indicates that line 4 is the current line.

To list the second line only, enter

LIST 2

Command Reference 5-57

LIST

The second line is displayed:

2* FROM EMP_DETAILS_VIEW

To list the current line (now line 2) to the last line, enter

LIST * LAST

You will then see this:

2FROM EMP_DETAILS_VIEW

3WHERE JOB_ID = ’SH_CLERK’ 4* ORDER BY DEPARTMENT_ID

5-58 iSQL*Plus User’s Guide and Reference

Соседние файлы в папке Oracle 9.0.1