1

I have a query that has an inline function:

with function with_f(p_text in varchar2) return varchar2 is
  begin
    return p_text;
  end;
select with_f(dummy) from dual

Is there a way to get the explain plan for that query in SQL Developer?

I tried this:

explain plan for (
with function with_f(p_text in varchar2) return varchar2 is
  begin
    return p_text;
  end;
select with_f(dummy) from dual
); 
select plan_table_output from table(dbms_xplan.display());

But I get the following error:

SQL Error: ORA-00933: SQL command not properly ended
00933. 00000 -  "SQL command not properly ended"
0

1 Answer 1

1

The parentheses around the statement are wrong. It is

explain plan for stmt

and not

explain plan for (stmt);


db<>fiddle

0

Your Answer

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

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