Re: Using Variable In Place of Table Name in SQL Statements (in Sproc)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: --CELKO-- (remove.jcelko212_at_earthlink.net)
Date: 12/07/04


Date: Mon, 06 Dec 2004 20:39:39 -0800


>> Sometimes questions are asked in order to satisfy an academic
curiosity .. <<

Forgetting the "this will destroy your database" part and taking it from
an academic viewpoint:

What is a table? It is a set of things of the same kind in the data
model.

Therefore, a procedure that could take any table, present and future
(Squids, Automobiles, Britney Spear's bank account, etc.), as a
parameter and actually return a meaningful within the data model would
be impossible. It would have to predict the future at least. It would
also lack cohesion since its inputs and outputs are undefined.

Procedures that handles tables qua tables are metadata functions.
Mixing data and metadata is as bad or worse than mixing logial and
physical implementation levels.

end of academic viewpoint.

--CELKO--
Please post DDL in a human-readable format and not a machne-generated
one. This way people do not have to guess what the keys, constraints,
Declarative Referential Integrity, datatypes, etc. in your schema are.
Sample data is also a good idea, along with clear specifications.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!