Re: When and when not to create SP/triggers
Posted in 1997
In article <19971230.13184939@ff>, Volker Fraenkle <VFraenkle@earthling.net> writes >You can only reduce network traffic, when you have a client/server >application. But if application and database server are running on the >same machine, this is no effect. > >You should use triggers, to manipulate data depending on other data >manipulation (e. g. updating a sum table, after insert, update or >delete of a row) > >You should use stored procedures to take business rules from the >application. The best application uses views to get data, stored >procedures to update data. In that case, it is much easier to port >your application to another database. > >Greetings volker > >>>>>>>>>>>>>>>>>>> Urspr'ngliche Nachricht <<<<<<<<<<<<<<<<<< > >Am 19.12.97, 00:03:08, schrieb kponn@aol.com (KPonn) zum Thema When >and when not to create SP/triggers: > > >> Hi, >> >> I am having trouble deciding when to (or when not to) create stored >procedures >> and/or triggres. I know they are useful and there is overhead >involved. We have >> PB application and all PB developers bug the hell out of me to create >triggers >> and SPs. How do I decide if an SP or trigger should be created or not >created. >> When I ask PB people why do you need it, I get "to reduce network >traffic" >> response. How can I get a better grip on this issue (books are not >helping me >> much!) ? >> >> Thanks. >> Keith > > > Check out the FAQ below, it has a section on Stored Procedures and when to use them. Just don't go over the top... I just had to debug:- 1. A 4GL program (called with no parameters) does update to a table 2. which fires off a trigger 3. which calls a stored procedure 4. which uses SYSTEM to run another 4GL program 5. which inserts into a table 6. which fires off another trigger 7. which calls a stored procedure 8. which uses SYSTEM to run another copy of the first program with a 9. parameter passed to it 10. which inserts an incorrect row into another table! I think stored procedures are ok but triggers NO! How do you debug code where an insert,update or delete does not just run but can also run other code which is not obvious from looking at the source code to the original program? -- David Williams Maintainer of the Informix FAQ Primary site (Beta Version) http://www.smooth1.demon.co.uk Official site http://www.iiug.org/techinfo/faq/faq_top.html I see you standin', Standin' on your own, It's such a lonely place for you, For you to be If you need a shoulder, Or if you need a friend, I'll be here standing, Until the bitter end... So don't chastise me Or think I, I mean you harm... All I ever wanted Was for you To know that I care