HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Result on execution of any SQL is number 2

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
resultnumbersqlanyexecution

Problem

After successful execution of any sql in oracle sql command line it shows 2
like i want to see the table or description of any table it show 2 instead of showing the table.

SQL> select * from dual
  2
SQL> select * from user_objects
  2
SQL>

Solution

You need to terminate the SQL statement with a semicolon (;) or a put a slash (/) in the new line instead of hitting Enter. For example: select from dual;. Otherwise SQLPlus will believe you have not finished your SQL statement, and it starts counting the lines. 2 is actually a line number, it is the 2nd line of your SQL statement. If you type nothing here and just hit Enter, SQLPlus will terminate your statement and return the prompt, it can not handle empty lines.

Context

StackExchange Database Administrators Q#126066, answer score: 8

Revisions (0)

No revisions yet.