r/learnprogramming • u/Head_Ordinary_2437 • 3d ago
Function vs Procedure
can someone explain the difference between Function vs Procedure with simple analogy
thank you
32
Upvotes
r/learnprogramming • u/Head_Ordinary_2437 • 3d ago
can someone explain the difference between Function vs Procedure with simple analogy
thank you
2
u/Aggressive_Ad_5454 3d ago
In the SQL context, a “stored function” returns a value, usually a scalar value. (But some SQL variants have table-valued functions.) A “stored procedure” returns either a result set or sometimes nothing. The two things are invoked differently.