Re: What is SPL?
Posted in 1996
Mail bounce. > > Hello, > > The question is the same as the subject. What is SPL? > > Thanks, > Julie Joseph > > Stored Procedure Language. It is a function essentially consisting of SQL code and extensions to SQL code. So you can do things like SELECT SPL(column) FROM TABLE. It resides at the server level and has a number of advantages: 1 - The work is done at the server so you don't have to collect a bunch of data and process it in client code. Saves bandwidth and improves performance drastically in some cases. 2 - Permissions are the permissions of the creator of the SPL, not of the user. So you can have an SPL update a table that is normally off limits to a user. This allows a 'DBA' to set up strict rules for updating/inserting rows and codify them in an SPL. Programmers would then be required to use the SPL to do any work against the table. 3 - They are memory resident - once invoked they hang around so they don't need to be reloaded. Saves time when invoking. 4 - a natural follow on for a trigger. Imagine something like: ON INSERT TO TABLE A CALL SPL(record.A); That is not the syntax - but it sounds more like english. There are some down sides as well. Once memory resident it stays there while your session (or whoever has called it) is current. Means that you can DROP the procedure, recreate it with new code, and when you call it you are still running the old code from memory (this is with 5.0). Time is not handled well. Time is set for all variables that require it at SPL invocation - so if you are trying to clock an SPL you need to do it from outside the SPL and not by putting in a set start time/ end time from within the SPL. You can't do things like 'UNLOAD'. There is limited ability to do string manipulation and no capability to retrieve anything from the OS. They're pretty neat. cheers j. _____________________________________________________________________________ Jack Parker - Hewlett Packard, DMD/IS Boise, Idaho, USA jparker@boi.hp.com Currently on loan to PLD/PE _____________________________________________________________________________ If anything can go wrong, fix it. To hell with Murphy. _____________________________________________________________________________ Any opinions expressed herein are my own and not those of my employers. _____________________________________________________________________________