Q
Problem solve Get help with specific problems with your technologies, process and projects.

Invoking a stored procedure in a select statement

How to invoke a stored procedure in a select statement?

How to invoke a stored procedure in a select statement?

You cannot invoke a stored procedure in a SELECT statement. However, you can call a function in a SELECT statement. The function can be a wrapper for the stored procedure. For instance, assume that I have a stored procedure called FOO. Let's create a wrapper function BAR that calls the stored proc:

CREATE FUNCTION bar ()
RETURN number
AS
BEGIN
   foo();
   RETURN 1;
END;
/

Now I can use the function above to execute the stored proc in my SELECT statement:

SELECT bar() FROM dual;

Dig Deeper on Oracle database design and architecture

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close