9
set NOEXEC ON;
Select * from emp;
Set NOEXEC OFF;

This validation is working in SQL Server. But It's not working in oracle.

Is there any syntax to check the query is valid or not in Oracle.

2
  • 1
    Why? What problem are you trying to solve that causes you to want to check the syntax without executing the query? It's possible that you want your client application to prepare the statement without executing it (or to use dbms_sql.prepare) but that would execute DDL statements. Commented Jun 9, 2015 at 5:12
  • more information about dbms_sql.prepare. (Possible duplicate) stackoverflow.com/questions/20745010/… Commented Jun 9, 2015 at 7:19

1 Answer 1

17

Using EXPLAIN PLAN

EXPLAIN PLAN FOR SELECT FROM emp;

ERROR at line 1: ORA-00936: missing expression

EXPLAIN PLAN FOR SELECT * FROM emp;

Explained

Sign up to request clarification or add additional context in comments.

3 Comments

In my worksheet PLAN is underlined as a mistake and I get an error when I run the command: SQL Error: ORA-00905: missing keyword 00905. 00000 - "missing keyword".
So what's the question in here? You are missing some keyword in your query.
Does this work only for select and not for alter queries?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.