Debugging

gporter

Member
Is there any way to see what is generated by the EXECUTE IMMEDIATE statement? I've got a statement that's dynamic pl/sql and I need to see what it compiles to debug it. Thanx
 
copy your execute immediate statement into a dbms_output.put_line statement before it.

eg.

execute immediate 'delete mytable where rowid = ''' | | p_rowid | | '''';

becomes

dbms_output.put_line( 'delete mytable where rowid = ''' | | p_rowid | | '''' );
execute immediate 'delete mytable where rowid = ''' | | p_rowid | | '''';

------------------
richard.brooker@vuw.ac.nz
 
Or, when stepping through your code, assign the statement to a local variable first:

stmt := 'delete mytable where rowid = ''' | | p_rowid | | '''';
execute immediate stmt;

After the debugger has reached the stmt assignment, you can easily inspect its value.

------------------
Marco Kalter
Allround Automations
 
Back
Top