Display results in output parameter in Toad

devang picture devang · Aug 23, 2010 · Viewed 39k times · Source

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..

Answer

Craig picture Craig · Sep 3, 2010

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;