SQL*Plus User's Guide and Reference Release 9.0.1 Part Number A88827-02 |
|
Learning SQL*Plus Basics, 5 of 5
While you use SQL*Plus, you may find that you need to list column definitions for a table, or start and stop the display that scrolls by. You may also need to interpret error messages you receive when you enter a command incorrectly or when there is a problem with Oracle or SQL*Plus. The following sections describe how to get help for those situations.
To see the definitions of each column in a given table or view, use the SQL*Plus DESCRIBE command.
To list the column definitions of the columns in the sample view EMP_DETAILS_VIEW, enter
DESCRIBE EMP_DETAILS_VIEW; Name Null? Type ----------------------------------------- -------- ---------------------------- EMPLOYEE_ID NOT NULL NUMBER(6) JOB_ID NOT NULL VARCHAR2(10) MANAGER_ID NUMBER(6) DEPARTMENT_ID NUMBER(4) LOCATION_ID NUMBER(4) COUNTRY_ID CHAR(2) FIRST_NAME VARCHAR2(20) LAST_NAME NOT NULL VARCHAR2(25) SALARY NUMBER(8,2) COMMISSION_PCT NUMBER(2,2) DEPARTMENT_NAME NOT NULL VARCHAR2(30) JOB_TITLE NOT NULL VARCHAR2(35) CITY NOT NULL VARCHAR2(30) STATE_PROVINCE VARCHAR2(25) COUNTRY_NAME VARCHAR2(40) REGION_NAME VARCHAR2(25)
Note: DESCRIBE accesses information in the Oracle data dictionary. You can also use SQL SELECT commands to access this and other information in the database. See your Oracle9i SQL Reference for details. |
To see the definition of a function or procedure, use the SQL*Plus DESCRIBE command.
To list the definition of a function called AFUNC, enter
DESCRIBE afunc FUNCTION afunc RETURNS NUMBER Argument Name Type In/Out Default? --------------- -------- -------- --------- F1 CHAR IN F2 NUMBER IN
Suppose that you wish to stop and examine the contents of the screen while displaying a long report or the definition of a table with many columns. The display will pause while you examine it. To continue, press Resume.
If you wish, you can use the PAUSE variable of the SQL*Plus SET command to have SQL*Plus pause after displaying each screen of a query or report. For more information, refer to the SET command in Chapter 8.
If SQL*Plus detects an error in a command, it displays an error message. See Appendix A, "SQL*Plus Error Messages" for a list of SQL*Plus error messages.
If you attempt to execute a file that does not exist or is unavailable by entering:
START EMPLYYES.SQL
An error message indicates that the table does not exist:
SP2-0310: unable to open file "emplyyes.sql"
You will often be able to figure out how to correct the problem from the message alone. If you need further explanation, take one of the following steps to determine the cause of the problem and how to correct it:
If the error is unnumbered, look up correct syntax for the command that generated the error in Chapter 8, "Command Reference" of this guide for a SQL*Plus command, in the Oracle9i SQL Reference for a SQL command, or in the PL/SQL User's Guide and Reference for a PL/SQL block. Otherwise, contact your DBA.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|