Display output parameter results in Toad

I have a stored procedure in Oracle and I use the out parameter in it. I want to know how to display output in Toad ..

+3
source share
3 answers

In the complaint scheme browser, click the Run button, which will generate some test code to call your procedure and write the OUT parameter via dbms_output. Check the output in the dbms_output window (you may need to activate the output in the dbms_output window using the two left icons)

+5
source

, , , . , , : dbms_output:

declare
  -- declare variable to store out data in.  Make sure datatype is correct
  v_out VARCHAR2(50);
begin
  -- call procedure, assigning value of out parameter to variable you declared
  my_proc(
    p_in => 3,
    p_out => v_out
  );
  -- display value now in variable
  dbms_output.put_line('Value of p_out: '||v_out);
end;
+4

In Toad, after executing the query, you can see several parameters, such as Data Grid, Auto Trace, DBMS Output, etc.

  • Go to the DBMS Output option.
  • If the output is off (red dot), then click on it to turn it on (green).
  • Now complete your query with CTRL+Enter
  • This will show the result after a second pause.

Trial Code:

DECLARE 
    c number(4);
BEGIN
    c := 4;
    dbms_output.put_line(c);
END;
/

enter image description here

0
source

Source: https://habr.com/ru/post/1761072/


All Articles