Re: SE7.23: using today +- n question
Posted in 2000
Jonathan Leffler wrote:
>
> Richard harnden wrote:
>
> > I had this problem too.
> >
> > Tried: INSERT ... VALUES(DATE(today - 3))
> > INSERT ... DATE(EXTEND(CURRENT, ...
> >
> > Nothing Works. (which is normal for my sql, btw :)
> >
> > Ended up having to insert TODAY, then:
> > UPDATE ... SET (datum) = (datum - 3) WHERE datum = TODAY
> >
> > Annoying.
> >
> > >>> Peter <proORGA-Leimen@t-online.de> 03/03/00 02:54pm >>>
> > using "select today - 3 from sysusers", works as expected,
> > using "insert into A (datum) values ( today) works again,
> > why will not work "insert into A (datum) values ( today - 3) ?
>
> Ah, the hysterical raisins strike again!
>
> Once upon a long time ago, there was a little computer manufacturer
> called IBM. They had a few people to spare, so they sent off Ted Codd
> and he invented relational databases. They still had a few people to
> spare, so they sent them off to create System/R and SQL, to implement
> an approximation to Ted's relational databases.
>
> They also invented a language called Embedded SQL for use within
> programming languages -- their language of choice was PL/1, with Cobol
> lurking in the wings too. None of the single-letter nonsense like C,
> of course, and no caffeinated languages either; they were far in the
> future.
>
> Anyway, to help programmers, they invented a syntax for inserting a
> set of values from a set of program variables into one row of a table:
>
> INSERT INTO TheTable VALUES(:var1, :var2, :var3, ..., :varN)>
> Now, it would be fiddly to work out how to evaluate expressions
> involving those values down in the DBMS, and the language could do that
> quite happily and even quicker, so...so we'll insist that only simple
> values are allowed in the VALUES list. No expressions.
>
> And lo, System/R was deemed a success, and was transformed into DB2,
> and became an ANSI and ISO standard, and no-one saw fit to fix the
> non-orthogonal nature of the values listed in the VALUES clause of
> an INSERT statement, even though luminaries such a C J Date (on whom
> be peace) pointed out the detrimental effects of such mis-features.
> The most noticeable such effect being the confusion it causes people
> new to the language who reason thusly:
>
> It works in this context; it works in this different context; this
> works and looks very similar -- why the blazes doesn't it work?
>
> Said people are then dreadfully disappointed when a cranky geek
> points out that unfortunately, their plausible logic is flawed
> because of hysterical raisins -- sometimes misspelled as historical
> reasons.
>
> :-(
I bet your little'un enjoys bedtime stories with YOU! :-)
... and Snow White said to the seven little computer hackers, can anyone
hack into the Queen's MirrorMate for me? I'd like to alter it's
expression handling routines ...
:-O
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /|
| http://www.informix.com http://www.informixhandbook.com |///// / //|
| http://www.iiug.org +-----------------------------------+//// / ///|
| |What year 2000 bug? year 2000 bug? |/// / ////|
| |year 2000 bug? year 2000 bug? year |// / /////|
| |2000 bug? year 2000 bug? year 1900 |/ ////////|
+----------------------+-----------------------------------+-----------+