Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display results in output parameter in Toad

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

like image 412
devang Avatar asked Dec 16 '22 22:12

devang


2 Answers

You just need to declare a variable to store the value in, and then do whatever you want with the data afterwards. If you are just wanting to see the output, dbms_output is probably the easiest way to go:

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;
like image 125
Craig Avatar answered Dec 28 '22 23:12

Craig


In the Toad schema browser, click the 'Execute' button, which will generate some test code for calling your procedure, and writing the OUT parameter via dbms_output. Check the output in the dbms_output window (you may need to activate output in the dbms_output window using the two leftmost icons)

like image 32
JulesLt Avatar answered Dec 29 '22 00:12

JulesLt