I didn't want to hijack someone else's thread, so I started a new one. Over here, jonadab mentioned not hardcoding database field names in your code. I would love to hear some good ideas to avoid scattering database field names all over my code.
Update Apparently I misunderstood jonadab's point. I in fact never rely upon the default order of fields, in any kind of SQL statement. But my question still stands, so read on. :-)
I have been building db apps for 5 years now and have not found a decent way to follow this advice. I have done a lot of web apps using languages like ASP with vbscript, vb.net, and C#, and a few using Perl. Every single application I have seen hardcodes the field names in the source code.
It gets worse when you use stored procedures in database servers that support them. Add on to that a data abstraction layer. Now you have the stored procedures to change, the data abstraction classes, and the code that uses those data abstraction classes. Any ideas?
In reply to Database field names in code by disciple
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |