Script files in SQLPlus: “The default file extension for SQLPlus scripts is .sql.” Decide whether this statement is correct in practice.

Difficulty: Easy

Correct Answer: Correct

Explanation:


Introduction / Context:
SQLPlus can execute SQL and PL/SQL scripts stored in files. Knowing the conventional file extension helps with tooling, editors, and discoverability. This question asks whether “.sql” is the default and customary extension for SQLPlus scripts.



Given Data / Assumptions:

  • Scripts are executed via START file, @file, or @@file within SQLPlus.
  • SQLPlus looks for the named file and, if no extension is supplied, assumes .sql by convention.
  • Operating system specifics (case sensitivity, path separators) do not alter the default extension convention.


Concept / Approach:
In SQLPlus usage, .sql is the de facto and traditional extension for script files. When you invoke @myscript without an extension, SQLPlus attempts myscript.sql in the current or SQLPATH directories. Other extensions can be used if fully specified (for example, @myscript.sqlx), but the default behavior and tooling expectations center around .sql. Therefore, stating that “the default extension for SQLPlus is .sql” is correct in everyday Oracle practice.



Step-by-Step Solution:

Create a file named demo.sql with SQL statements.In SQLPlus, run @demo → SQLPlus locates demo.sql and executes it.Rename the file with a nonstandard extension and try @demo → not found unless you supply the extension.Conclusion: .sql is the default expected extension.


Verification / Alternative check:
Check SQLPlus documentation for the START/@ command behavior and SQLPATH lookup; verify on your environment by experimenting with file names.



Why Other Options Are Wrong:

  • Platform, SPOOL usage, or PL/SQL content do not change the extension convention.


Common Pitfalls:
Forgetting SQLPATH; placing scripts in directories not on the path; assuming the client will guess a non-.sql extension.



Final Answer:
Correct

More Questions from Managing Databases with Oracle

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion