I agree with your comments, exactly.
Remember, I stated that I was working with a "Legacy" database which was
originally designed (actually hacked is a better word), in 1996.
You are correct in assuming that the guy screwed everything up.
In fact I the database and client software he created, is the most
complicated fucked up system I have ever seen.
He had no plan, he just coded his way around everything. The source code
(VB6), is a mess, and unfix-able.
We are converting data from the old database, into the new database, and so
this is why I asked for help with the unusual query.
Unfortunately, no one killed him, he was only fired, and so he is currently
looking for a job working at your company!
Russell Mangel
Las Vegas, NV
[quoted text, click to view] "--CELKO--" <jcelko212@earthlink.net> wrote in message
news:1108393095.064840.174150@f14g2000cwb.googlegroups.com...
> Why not just get rid of this poorly defined and coded module? It has
> no cohesion at all -- what would you properly name it? The "find
> _max_squid_or_employee_or_bankaccount_or.. or_apples_id" procedure!
>
> Passing table names is absurd as well as a violation of the basic
> prinicples of software engineering. Since each table is a totally
> different kind of thing, their identifiers will be totally different.
> You can get a SSN, a phone number or an ISBN back from this disaster.
>
> But if you are determiened to keep doing it wrong, use dynamic SQL and
> expect to get SQL injections, loss of integrity and loss of security.
>
> Then find the guy that wrote this and kill him to prevent future
> problems :) Then completely re-design this schema. The number of
> tables sounds too high for a medium sized business and if he writes
> code like this, he probably screwed up everything from the start.
>