Storing query language in relations

From: Paul <pbrazier_at_cosmos-uk.co.uk>
Date: 23 Sep 2002 02:46:29 -0700
Message-ID: <51d64140.0209230146.320e13b2_at_posting.google.com>



This is just an idea I've been having, I'm not sure if it's been visited before or if it's not worth pursuing.

If we accept that a relational database is the most logical way to hold structured data, why not go a step further and store the actual queries in relational format? I know some DBMSs store the text of queries, view definitions, stored procedures etc. in tables but not in a normalised fashion.

An advantage would be that the DB constraints would automatically validate the query so no need for parsing SQL code for syntax. Maybe it could be used for storing other (procedural) languages as well like C - it would be useful for large software projects - no need for loads of files and subdirectories and client apps could quickly find function definitions etc.

Wasn't one of Codd's guidelines that metadata should also be stored relationally? I know the table definitions (DDL) are in many DBMSs. But generally a separation is made between the database and its query language (DML).

I've not thought too deeply about how a schema for SQL queries (for example) could be implemented but it must be possible (kind of like the MS Access query grid but normalised).

Is this taking things too far or might this line of thinking produce something useful? Has this been done already in some DBMS?

Paul. Received on Mon Sep 23 2002 - 11:46:29 CEST

Original text of this message