Need Help to Display PL/SQL SELECT in SQL Developer/TOAD Query Results
Hello. I do not know if this is possible, but I am trying to use an anonymous PL/SQL block to create a function, and then use that function in a SQL statement. I would like the results of the query to be displayed in the "Query Results" windows of SQL Developer or Toad. I know I can print the results using DBMS_OUTPUT, but this is not what I want. Lastly, some people might ask why I want to use an anonymous block, but I am an analyst (not a DBA), so I do not have CREATE privileges.
Here is a quick example of what I am trying to accomplish:
DECLARE
FUNCTION some_function(x NUMBER) RETURN NUMBER IS
BEGIN
return x;
END;
BEGIN
--I know I can do this, but I don't want to print it:*
dbms_output.put_line(some_function(100));
--I would like to display onto the SQL Developer/Toad grid result,*
--similar to just executing a select statement. This does not work:*
SELECT some_function(100) FROM tbl_accts;
END;
Thank you very much in advance for the help.