SQLPlus script execution: does START filename run the file automatically?
-
AValid (START executes the specified script file, like @)
-
BInvalid (START only loads the file into the buffer)
-
CDepends on the presence of a trailing slash in the file
-
DWorks only for .sql files with uppercase names
-
ERequires SYSDBA privileges to execute
Answer
Correct Answer: Valid (START executes the specified script file, like @)
Explanation
Introduction / Context: SQLPlus provides several ways to run external SQL scripts. The START command (and its shorthand @) reads and executes a script file. This question verifies that you know START actually runs the file, rather than merely loading it into the buffer.
Given Data / Assumptions:
- You have a .sql file on disk.
- SQLPlus has access to that path (current directory or full path given).
- The script contains valid SQL and/or PL/SQL commands.
Concept / Approach: Typing START myscript.sql or @myscript.sql causes SQLPlus to read commands from the file and execute them in order, echoing results as they run. No extra slash is required unless a PL/SQL block in the file ends with END; and relies on slash execution semantics (most scripts include the ending slash themselves).
Step-by-Step Solution:
Place SQL statements in myscript.sql.In SQL*Plus, run START myscript.sql or @myscript.sql.Observe statements executing sequentially with output/errors displayed.Use @@ for nested script calls relative to the current script directory.Verification / Alternative check: Compare behavior to EDIT; EDIT opens the buffer in an editor, while START executes immediately. START and @ behave equivalently.
Why Other Options Are Wrong:
- START does not merely load; it executes.
- File name case, extensions, and SYSDBA are not requirements (path/access matters).
Common Pitfalls: Using relative paths incorrectly; forgetting the trailing slash for PL/SQL blocks inside the file; lacking privileges for statements inside the script.
Final Answer: Valid (START executes the specified script file, like @)