Start Stored procedure insert not updating database

Stored procedure insert not updating database

Many relational databases nowadays have views, constraints, referential integrity with cascading update, delete, stored functions, triggers and the like.

MS Access has a fairly sophisticated update algorithm for queries in that it automatically makes one table and even multi-table queries updateable and allows deletes if you define primary keys appropriately.

Also depending on the field a column comes from it will update that and also automatically create child records in child tables if you try to update a child column when there is no record.

Stored procedures are one of numerous mechanisms of encapsulating database logic in the database.

They are similar to regular programming language procedures in that they take arguments, do something, and sometimes return results and sometimes even change the values of the arguments they take when arguments are declared as output parameters.

Views are most useful when you always need to join the same set of tables say an Order with an Order Detail to get summary calculation fields etc.

3 In many databases Views are read-only and complex views are rarely updateable.

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.

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.

Makes me wonder if these people have ever worked with modern databases.