How to get return value from function in Oracle using Toad

How to find out what function return value is in Toad?

I am running something like this code:

declare r number; begin r:= packagename.functionname(paraname); end; 

I can’t understand how to get the β€œr” returned to the data grid, some messages suggest using the DBMS output, but nothing is written when the code is run.

A function performs updates, commits, calls other functions, and has cursors.

+7
source share
3 answers
 begin dbms_output.put_line(packagename.functionname(paraname)); end; 

Before starting, you must enable the output. To do this, select the "DBMS Output" tab at the bottom of the editor, then click the leftmost button under the tab (it should display a red circle using the "Turn Output On" tooltip (if it is a green circle, the output is already on)).

The query results will be written to the "DBMS Output" window, not the "Data Grid" (you may need a few seconds for the survey to catch the results). If you use a custom type or ref cursor, this will not be enough, and you will need to process the results in an anonymous block before writing them.

+13
source

How about just:

 select packagename.functionname(paraname) from dual; 
+8
source

Klaus answer

select file_file_name .functionname (paraname) from double;

worked for me, but it only returned the cursor. This appears as (CURSOR) in the data grid in Toad. As soon as I double-clicked on it, he opened new windows with a data grid for this cursor, and I saw my results.

-one
source

All Articles