I have code like this:
set serveroutput on
declare
v_str varchar2(200);
begin
v_str := q'!dbms_output.put_line('Hello world');!';
Execute immediate v_str;
end;
Oracle SQL Developer says that there's invalid SQL Statement, what's the problem?
declare
v_str varchar2(200);
begin
v_str := q'!begin dbms_output.put_line('Hello world'); end;!';
Execute immediate v_str;
end;
/
works...
dbms_output is a procedure and so can only be executed within a PL/SQL block.q syntax is in the documentation under text literals.
show errto print detail on the error.