3 ms·
The fundamental question is where and what you are doing. As I say, I use select * a lot, but these are in two groups: 1. In UDF's to ensure the proper retur
by einhverfr 13y ago
The fundamental question is where and what you are doing.
As I say, I use select * a lot, but these are in two groups:
1. In UDF's to ensure the proper return type, and
2. Against UDF's where it is the UDF designer's job to maintain the software interface contract.
In those cases, select * works, but it only does so because you have dependency injection and can decide on a case-by-case basis whether to pass the changes up, wrap them in a view, or the like. Most of the time this is a simple choice. The app needs a new column that we are storing and so.... But in a multi-app environment there may be other choices, and that dependency injection makes all the difference in the world.
EDIT: for example, if you have a UDF returning the type of a given table, then you may want to use select * because you have already decided these are to be tied together. Similarly select * from my_udf() is not a bad thing the way that select * from my_table is.
- jacques_chester 13y agoAh, well. I guess my point was about selecting from tables, which is still the common case. I presume that if you find yourself picking columns out of UDFs, it's a code smell that the UDF needs rethinking.