select query in sqlplus(oracle) not working?

connect to oracle database command line
run sql script from command line oracle
batch script to connect to oracle database and run query
sqlplus command example
how to run sql script in sqlplus command line in linux
sql developer
how to connect sql command line in oracle 11g
sqlplus basic commands

I have oracle database server. I use sqlplus for select some infomation of database. But it seem not working (result like this) ? It will alway display "2" for all query "select". Something is went wrong?

Can you try using statement terminator, i.e. ; at the end of statement. Something like

select sysdate from dual;

SQL*Plus Basics, SQL commands, for working with information in the database; PL/SQL blocks, also for working Sometimes, the result from a query will not fit the available page width. In Example 5-1, "Entering a SQL Command", for instance, the SELECT and FROM refer to "SQL*Plus Configuration" and to "The SQLPLUS Command". sqlplus prompt expect multi-line query if you are not giving the query terminator and shows number. Hence you were getting 2 as 2nd line number. its not showing you the output rather its making the cursor go to next line which is 2.

sqlplus prompt expect multi-line query if you are not giving the query terminator and shows number. Hence you were getting 2 as 2nd line number.

A Using SQL Command Line, SQL commands, for working with information in the database Sometimes, the result from a query will not fit the available page width. In Example 4-3, "​Entering a SQL Command", for instance, the SELECT and FROM See SQL*​Plus Configuration and SQLPLUS Program Syntax for details on the SQL*Plus LOGIN file. >Query Run In:Query Result Your spool file ends up with just: SQL> SELECT /*csv*/* from Table_name; SQL> spool off If you do 'Run Script' (F5) instead, then the output does not go to the Query Result window, and instead is shown in the Script Output window; and is also written to the spool file.

its not showing you the output rather its making the cursor go to next line which is 2.

Connecting to Oracle Database and Exploring It, At the command prompt, type sqlplus and then press the key Enter. At the user name If the Oracle pane is not showing, click the tab Oracle. In the Oracle A query, or SQL SELECT statement, selects data from one or more tables or views. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more Underscore is not working in oracle like clause

Formatting SQL*Plus Reports, Disabling Commands with SQLPLUS -RESTRICT · Program Argument Security This chapter explains how to format your query results to produce a finished report. This chapter does not discuss HTML output, but covers the following topics: When you use an ORDER BY clause in your SQL SELECT command, rows with  To enter and execute SQL statements or commands, enter the statement or command at the SQL prompt. At the end of a SQL statement, put a semi-colon (;) and then press the Enter key to execute the statement. For example: SQL> SELECT * FROM employees; If the statement does not fit on one line, enter the first line and press the Enter key. Continue

Starting SQL*Plus, You must connect to an Oracle Database (instance) before you can query or as an argument to the SQLPLUS Program Syntax when starting a command-line session. Select Command Prompt from Programs->Accessories in the Start menu. In iSQL*Plus, the EXIT or QUIT command halts the script currently running,  The NOT EXISTS operator returns true if the subquery returns no row. Otherwise, it returns false. Note that the NOT EXISTS operator returns false if the subquery returns any rows with a NULL value. Oracle NOT EXISTS examples. See the following customers and orders tables in the sample database: The following statement finds all customers who

SQL*Plus Command Reference, Sets the text that represents a null value in the result of a SQL SELECT command​. Enables you to control scrolling of your terminal when running reports. TRACEONLY displays a trace report, but does not print query data, if any. EXPLAIN SET MARKUP has the same options and behavior as SQLPLUS -​MARKUP. Tom, Instead of SQL> select count (*) from emp T1 2 where not exists ( select null from emp T2 where t2.mgr = t1.empno ); you could have used SQL> select count (*) from emp T1 2 where not exists ( select mgr from emp T2 where t2.mgr = t1.empno ); Could you tell what circumstances do we use "select null" instead of "select <value>". Are

Comments
  • That is how statements can be entered over multiple lines. To run your query end a line with a semi-colon ;.
  • @Brian ; is just the default sqlterminator, although to be fair nobody ever changes it. The / character doesn't change though.