Home » SQL & PL/SQL » SQL & PL/SQL » calling a function as a input parameter for a stored procedure (oracle 11g release 2 )
calling a function as a input parameter for a stored procedure [message #661319] Tue, 14 March 2017 09:25 Go to next message
raj85844
Messages: 26
Registered: November 2016
Location: chennai
Junior Member
Hi Team,

would like to know is it possible to call a function as a input parameter in stored procedure


Cheers
R
Re: calling a function as a input parameter for a stored procedure [message #661322 is a reply to message #661319] Tue, 14 March 2017 09:43 Go to previous messageGo to next message
cookiemonster
Messages: 13017
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why don't you just try it?
Re: calling a function as a input parameter for a stored procedure [message #661324 is a reply to message #661319] Tue, 14 March 2017 10:02 Go to previous messageGo to next message
BlackSwan
Messages: 25858
Registered: January 2009
Location: SoCal
Senior Member
raj85844 wrote on Tue, 14 March 2017 07:25
Hi Team,

would like to know is it possible to call a function as a input parameter in stored procedure

Not possible
Can you prove me wrong?
Re: calling a function as a input parameter for a stored procedure [message #661327 is a reply to message #661324] Tue, 14 March 2017 10:14 Go to previous messageGo to next message
raj85844
Messages: 26
Registered: November 2016
Location: chennai
Junior Member
Here I am trying to use the result of the function .... Variable as a input parameter in procedure
Re: calling a function as a input parameter for a stored procedure [message #661328 is a reply to message #661327] Tue, 14 March 2017 10:28 Go to previous messageGo to next message
cookiemonster
Messages: 13017
Registered: September 2008
Location: Rainy Manchester
Senior Member
And what exactly is stopping you?
Re: calling a function as a input parameter for a stored procedure [message #661329 is a reply to message #661328] Tue, 14 March 2017 11:03 Go to previous messageGo to next message
ThomasG
Messages: 3205
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Well. A hint:

dbms_output.put_line is a procedure.
sysdate is a function.

Testing if it can be done will take about 2.352 seconds.

Re: calling a function as a input parameter for a stored procedure [message #661380 is a reply to message #661329] Thu, 16 March 2017 07:31 Go to previous message
Bill B
Messages: 1718
Registered: December 2004
Senior Member
of course you can.

exec my_proc(sysdate,'xyz',my_function('aaa'));

is perfectly legal as long as the parameters are only IN. You can't return a value into a function OR a literal string.

[Updated on: Thu, 16 March 2017 08:10]

Report message to a moderator

Previous Topic: dynamically creating index from same table in different schema
Next Topic: ORACLE sql HELP NEEDED
Goto Forum:
  


Current Time: Sat Feb 24 19:56:14 CST 2018

Total time taken to generate the page: 0.38388 seconds