Re: Table names as variables?
Posted in 1994
> Whadd'ya think? Will table names ever be able to be represented as > variables? Something like this could make SPL incredibly powerful for > maintenance and routine tasks. Or shall we just stick with requiring an > additional language (ESQL, 4GL, Shell script) to do such *complex* > activities such as looping through many tables in a data base? > -- > Scott F. Ford, DBA / Unix SA | sford@wvus.org I understand your point and would wish that something like this could be done but in some ways it destroys the purpose of Stored Procedures. SP's are designed as packaged, pre-optimised objects loaded into the database to have a specific purpose. They are prefereable to external code because:- 1) They reduce the amount of traffic between the client and the server. 2) They allow priviliged code to be used by non priviliged users. 3) They "generally" operate faster as they are pre-optimised. 4) They allow for more volatile database design as they can be re-written without the client software needing to be changed. The third item is really the key here. If code in a stored procedure is allowed to be dynamic then all advantages with pre-optimised code is lost. Despite this, as benefits 1, 2 and 4 would still exist, I would vote for a new type of stored procedure that allowed dynamic code. I would even go for stored procedures that could call externally written library functions or processes. This would allow you even more flexibility. Do I want this before or after the introduction of a clipped function and variables for subscripted character strings? I want it all at the same time and last week at that :-) Cheers - Jim My opinions are my own. They may vary with time but they remain MINE! ---------------------------------------------------------------------- Name: Jim Gordon Company: DHL Systems Inc, Burlingame, CA, USA ----------------------------------------------------------------------