I'm trying to debug a stored procedure (Oracle). I want to print some variables.
I don't know what the command to print is (or where to find it). Can anyone tell me what it is?
Thanks
EDIT:
This is my trigger:
create or replace
procedure bns_saa_confs_update_state (
theID in varchar2
)
AS
begin
UPDATE BNS_SAA_CONFIRMATIONS SET SentToWssStatus='T' WHERE ID=theID;
commit;
end;
I want to print theID
In Oracle, you can debug the following program units (PL/SQL programs): anonymous blocks, packages, procedures, functions, and triggers.
Use the DBMS_OUTPUT package. Another possible method is to use the SHOW ERROR command.
execute immediate q'[select destination from temp_1 where cond1 =(:var1) and cond2 = (:var2) into dest]' using sd(i),sid1(i); return dest; -- or printline dbms_output. put_line(dest);
Use the dbms_output.put_line()
function:
declare
my_var varchar2(20);
begin
my_var := 'Hello World';
dbms_output.put_line(my_var);
end;
/
Make sure you have set serveroutput on
if running from SQLPlus, or set output on if running from an IDE. Some developers will create a wrapper function to simplify debugging.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With