Sql*Plus User’s Guide and Reference
Download 5.34 Mb. Pdf ko'rish
|
E18404-12
- Bu sahifa navigatsiya:
- Running Scripts
5-9
2. Do not put comments after statement terminators (period, semicolon or slash). For example, if you enter: SELECT 'Y' FROM DUAL; -- TESTING You get the following error: SQL*Plus expects no text after a statement terminator and is unable to process the command. 3. Do not put statement termination characters at the end of a comment line or after comments in a SQL statement or a PL/SQL block. For example, if you enter: SELECT * -- COMMENT; You get the following error: The semicolon is interpreted as a statement terminator and SQL*Plus submits the partially formed SQL command to the server for processing, resulting in an error. 4. Do not use ampersand characters '&' in comments in a SQL statement or PL/SQL block. For example, if you enter a script such as: SELECT REGION_NAME, CITY /* THIS & THAT */ FROM EMP_DETAILS_VIEW WHERE SALARY>12000; SQL*Plus interprets text after the ampersand character "&" as a substitution variable and prompts for the value of the variable, &that: You can SET DEFINE OFF to prevent scanning for the substitution character. SELECT 'Y' FROM DUAL; -- TESTING * ERROR at line 1: ORA-00911: invalid character -- COMMENT * ERROR at line 2: ORA-00923: FROM keyword not found where expected Enter value for that: old 2: /* THIS & THAT */ new 2: /* THIS */ REGION_NAME CITY ------------------------- ------------------------------ Americas Seattle Americas Seattle Americas Seattle Europe Oxford Europe Oxford Americas Toronto 6 rows selected. Running Scripts 5-10 SQL*Plus User's Guide and Reference For more information on substitution and termination characters, see DEFINE, SQLTERMINATOR and SQLBLANKLINES in the SET command on page 12-88. Running Scripts The START command retrieves a script and runs the commands it contains. Use START to run a script containing SQL commands, PL/SQL blocks, and SQL*Plus commands. You can have many commands in the file. Follow the START command with the name of the file: START file_name SQL*Plus assumes the file has a .SQL extension by default. Download 5.34 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling