Updating relational databases through views
Updating relational databases through views - Free desi sex chatroom without registration
A lot of people in the database and programming professions are vehemently in favor or opposed to the use of stored procedures and the like in databases.They will argue that all access to the database should go thru stored procedures because it is more secure and shields applications from changing logic.
The danger of such a term is that it gives one a sense that there is no need to question a practice because it is always best.
Makes me wonder if these people have ever worked with modern databases.
Stored procedures are one of the oldest methods of encapsulating database logic, but they are not the only method available.
The other side will vehemently argue that you should avoid this because not all databases support this and the way each supports it is different so your code is less portable.
I would start by saying those individuals who are vehemently on one side or the other should open their minds a little.
Often you will find that even in a single application a mixture of approaches works best.
Before dismissing one approach over another, it is important to map out what you are trying to achieve and then determine how using one approach aligns with your objectives.5 (one of the great strengths of stored procedures is that you can have long transactions of sql statements and conditional loops which can be all committed at once or rolled back as a unit. 2 (note most databases allow to define optional arguments, but this can become very unwieldy to maintain if there are a lot because you end up duplicating logic even within the stored function so is generally avoided) 4 –For databases such as SQL Server, Postgre SQL, DB 2, Oracle that allow return tables and sets, you can selectively pick fields you want from within a query.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.Note that for example some databases such as Oracle, Postgre SQL, MS SQL Server , SQLite will allow you to update even a complex view by using an instead of trigger or rule against the view.My SQL 5, MS SQL Server and some others automatically make one table views updateable.2 (note most databases allow to define optional arguments, but this can become very unwieldy to maintain if there are a lot because you end up duplicating logic even within the stored procedure so is generally avoided) 3 (you can not reuse them in views, rarely in stored functions and other stored procedures unless the stored procedure using it does not require a return value or result query). 3 –again in theory it can, but very hard to maintain since you would often be duplicating logic to say return one field in one situation and other set of fields in another situation or update a field when the field is passed in as an argument.