Re: globals besides relvars?

From: Paul Vernon <paul.vernon_at_ukk.ibmm.comm>
Date: Tue, 29 Jul 2003 10:51:04 +0100
Message-ID: <bg5g75$1id4$>

"Marshall Spight" <> wrote in message news:0DlVa.3203$Oz4.625_at_rwcrnsc54...
> "Paul Vernon" <paul.vernon_at_ukk.ibmm.comm> wrote in message news:bg3oc0$1ec0$
> > "Marshall Spight" <> wrote in message
> > news:WqcVa.148132$GL4.38052_at_rwcrnsc53...
> > [snip]
> > > For many things, a functional expression is better than the relational
> > > equivalent. For example, I'd rather invoke the getTimeZone() function
> > > than:
> > >
> > > Select * from TimeZone
> > > unwrap relation into tuple
> > > unwrap tuple into value
> >
> > Marshall, you are arguing about syntax, but..
> >
> > [snip]
> > > Okay, I'm talking about the logical model of things.
> >
> > ..claim to be interested in the logical model.
> >
> > Syntax is mostly unimportant when at the logical level.

> Sure. But I'm not talking about syntax; I'm talking about eliminating
> logically unnecessary logical operators.

OK, but you only need the unwraps when you are moving out of the relational paradim, into say a functional language.
My answer is to keep as much as possiable (prefereably *everything*) within the relational world.

> > [snip]
> > > Don't functions have access to the database?
> >
> > No.
> >
> > > Or do some of them have this access?
> >
> > No
> >
> > > *Some* code somewhere has to be able to access the database,
> >
> > Yes. Queries and Updates.
> What about application code?

If we can do everything with relational programs, then we have no need for 'application code'. We just have Queries and Updates of the relational algebra.

>What about stored procedures

Nope, they don't exisit either.

>, or code that we'd like to run on the database because it's close to > the data.

Queries and Updates.

>Can't queries and updates exist inside functions, procedures, > methods, what have you, in an application?

There is no 'applicaiton' :-)

Now that is a little bit simplistic I'll admit. We do need something that responds to events (to input). We do need input and output devises. But all of this can (hopefully) be cast in terms much closer to the relational paradigm. Certainly the event stuff can.

> > [snip]
> > > I'm groping my way towards a model where the concept of a
> > > programming language's global variables
> >
> > The database is the only global variable. In fact it is the only varable *at

> I buy the "database is the only global variable." In fact, I think it makes sense
> to say this is true by definition. But the only variable *at all* is overstatement.
> What about local variables inside a function?

TTM has 'local' variables. Personally I'm not at all sure we need them. I don't think that a relational programming language would have them. A Functional program has no variables at all - right?

> > If you do still want to talk about 'functions' that can access the global
> > then SQL table functions could be the place to start. They do things that you
> > do with views, and their functionally is required in any good dbms IMO, but to my
> > of thinking, they are little more than macro expressions. Does suggest again
that we
> > need a better handle on how macros fit into things though.

> Okay.

Paul Vernon
Business Intelligence, IBM Global Services Received on Tue Jul 29 2003 - 11:51:04 CEST

Original text of this message