Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Consider:

SQL> select sysdate from dual;

SYSDATE
-----------
22-Aug-13 0

SQL> select sysdate from dual; select sysdate from dual;

select sysdate from dual; select sysdate from dual

ORA-00911: invalid character

SQL> 

Notice that when I execute two queries at once in the command window, it throws the ORA-00911: invalid character error which generally indicates syntactic error.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

It is a syntax error.

SQL*Plus expects either:

  • A single SQL command, terminated by either a ";" character or a "/" on a line by itself.
  • A PL/SQL block
  • A SQL*Plus command

What you have entered is 2 queries on a single line, which SQL*Plus will send to the RDBMS - Oracle will then try and parse the string sent as a single query and fail because it is not valid SQL.

See the documentation for more details: http://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_four.htm#i1039424

share|improve this answer
    
Thanks for including the link to the documentation Phil! That clears it for me.. as when I run multiple queries in a Program window in PLSQL developer, it is intelligent enough to execute each one separately. –  Kent Pawar Aug 22 '13 at 10:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.