Sql updating multiple rows with different values
Just follow Best Practices outlined by an authority in the subject matter and things will magically fall into place.
Rather than just focus on Best Practices, I would like to propose that one should think about what they are trying to achieve and why one approach is better than another to get there.
So although the function always outputs the same number of fields, you can selectively use only some similar to what you can do with views.Example you may have one part of an application that needs to talk to a mainframe database or run scheduled tasks, and given that it doesn’t make sense to drive your whole application structure based on the need of this single functionality.I always find it amusing that when people talk about database logic they are very focused on stored procedures and its almost like nothing else exists.This is not true for scalar functions (My SQL 5.1- only supports scalar functions).Views are one of the greatest things invented since sliced bread.
The main beauty of a view is that it can be used like a table in most situations, but unlike a table, it can encapsulate very complex calculations and commonly used joins.