Re: Queries as data

From: Pierre Pönisch <Pierre.Poenisch_at_Informatik.TU-Chemnitz.de>
Date: Wed, 28 May 2003 12:55:25 +0200
Message-ID: <bb24hs$bsk$1_at_narses.hrz.tu-chemnitz.de>


Juan Pardillos wrote:

> Hi everybody,
>
> does anyone know what's the idea of treating "queries as data"? I've
> heard about that, but I don't know the meaning nor the advantages.
>
> Any idea is greatly appreciated.

Hi Juan,

the idea is that you can store sql queries as an attribute in a table. When you later want to retrieve this attribute the querie is processed and you will get the result of this querie as the value of this attribute.

You can compare it to the creation of a view. When you create a view the DBMS doesn't create a table or something like that. It just stores the query (the select statement) in a system table and when you want to have data from this view the query is processed and you get the result.

In my opinion treating "queries as data" is very dangerous, because the query can also be a delete or drop or something like that. You can also create recursions.
e.g.: when you use a select statement in attribute ATTR that looks like select ATTR from ....

So the DBMS runs into a circle and maybe will crash :-(

Do you know any database system that can do this?

Greetings,
Pierre Received on Wed May 28 2003 - 12:55:25 CEST

Original text of this message