SQLPlus Scripts — Default File Extension When saving SQL scripts for use with Oracle SQLPlus, what is the default and conventional filename extension that SQLPlus expects?

Difficulty: Easy

Correct Answer: .sql

Explanation:


Introduction:
SQLPlus is Oracle’s classic command-line tool for running SQL and PL/SQL scripts. Consistent file naming conventions make automation and execution straightforward. This question checks your knowledge of the conventional default extension used for SQLPlus script files.


Given Data / Assumptions:

  • You are saving a SQL script to be executed with START or @ in SQLPlus.
  • Extensions help users and tools recognize file types quickly.
  • The goal is to choose the standard extension used across examples and documentation.


Concept / Approach:
SQLPlus runs scripts with START file or @file. Although you can execute files without an extension by specifying the exact name, the convention in Oracle documentation and practice is to save SQL command files with the .sql extension. Other extensions (.pls for PL/SQL packages in some shops, .ctl for SQLLoader control files, .ora for network/parameter files) serve different purposes and are not the default for SQLPlus scripts.


Step-by-Step Solution:
1) Identify the tool and use case: running SQL scripts in SQLPlus.2) Recall standard examples using @script.sql or START script.sql.3) Select .sql as the expected extension.


Verification / Alternative check:
Oracle tutorials and guides consistently show .sql for SQLPlus scripts, confirming the convention.


Why Other Options Are Wrong:

  • .txt: Plain text, not the standard for executable SQL scripts.
  • .pls: Sometimes used informally for PL/SQL sources, but not the SQLPlus default.
  • .ora: Oracle Net and parameter files (tnsnames.ora, sqlnet.ora, init*.ora).
  • .ctl: SQL*Loader control files.


Common Pitfalls:
Naming scripts inconsistently makes automation harder; standardize on .sql for clarity and tooling support.


Final Answer:
.sql

Discussion & Comments

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