[Tfug] Any SQL gurus out there?
Robert Hunter
hunter at tfug.org
Thu Oct 25 13:25:39 MST 2007
On 10/25/07, Jim March <1.jim.march at gmail.com> wrote:
> In general terms, how common would it be to include "program code"
> inside an SQL database? Wouldn't that be considered, at a minimum,
> squirrelly?
Hi, Jim.
Those were excellent comments about stored procedures. If that is
what you were talking about, then disregard the rest of this email.
There is nothing inherently wrong with storing code in a database.
Databases are collections of structured data, that can be queried and
updated. If storing code in such a system makes sense, then why not?
Obviously, the real question is what would be the purpose of doing so?
For example, one application which stores "code" in a database, is
version control. Such systems need to keep a history of changes to
code, as well as all sorts of meta data. An SQL database could
reasonably assume a role in this kind of a system. However, in this
scenario, the data (code) is probably not meant to execute in the
context of the RDBMS.
Now consider AI applications, such as "expert systems", which perform
analyses based on "rules" which have been supplied by human designers.
These rules could be directly encoded into the programming text, or
they could be stored in a database, and retrieved as needed. In
either case, program execution is governed by these rules, and it
doesn't matter how the rules are stored, except perhaps for other
reasons, such as efficiency, etc.
--
Rob
More information about the tfug
mailing list