Sql*Plus User’s Guide and Reference


Sending a Message and Accepting Return as Input


Download 5.34 Mb.
Pdf ko'rish
bet74/103
Sana04.08.2023
Hajmi5.34 Mb.
#1665146
1   ...   70   71   72   73   74   75   76   77   ...   103
Bog'liq
E18404-12

Sending a Message and Accepting Return as Input
If you want to display a message on the user's screen and then have the user press 
Return after reading the message, use the SQL*Plus command PAUSE. For example, 
you might include the following lines in a script:
PROMPT Before continuing, make sure you have your account card.
PAUSE Press RETURN to continue.
Clearing the Screen
If you want to clear the screen before displaying a report (or at any other time), 
include the SQL*Plus CLEAR command with its SCREEN clause at the appropriate 
point in your script, using the following format:
CLEAR SCREEN
Before continuing to the next section, reset all columns to their original formats and 
headings by entering the following command:
CLEAR COLUMNS
Using Bind Variables
Bind variables are variables you create in SQL*Plus and then reference in PL/SQL or 
SQL. If you create a bind variable in SQL*Plus, you can use the variable as you would 
a declared variable in your PL/SQL subprogram and then access the variable from 
SQL*Plus. You can use bind variables for such things as storing return codes or 
debugging your PL/SQL subprograms.
Because bind variables are recognized by SQL*Plus, you can display their values in 
SQL*Plus or reference them in PL/SQL subprograms that you run in SQL*Plus.
Creating Bind Variables
You create bind variables in SQL*Plus with the VARIABLE command. For example
VARIABLE ret_val NUMBER
This command creates a bind variable named ret_val with a datatype of NUMBER. See 
the 
VARIABLE
 command on page 12-191 for more information. (To list all bind 
variables created in a session, type VARIABLE without any arguments.)
Enter a valid employee ID
For Example 145, 206
Employee ID. :
SP2-0425: "one" is not a valid number


Using REFCURSOR Bind Variables

Download 5.34 Mb.

Do'stlaringiz bilan baham:
1   ...   70   71   72   73   74   75   76   77   ...   103




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling