Predefined variables

During the installation of SQL*Plus, eight variables are created and initialized. We will refer to them as predefined variables.




Identifier of connection if available.


Current date


Information of editor used by EDIT command.


Detailed release number of Oracle Database.


Version of installed Oracle database.


Current users privilege level


Details of installed SQL*Plus component.


Name of the user

Let's create the script to get information about the predefined variables:

#!/bin/bash sqlplus user1/Test123 <<MY_QUERY define MY_QUERY Save the script ...

Get Learning Linux Shell Scripting - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.