Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: MAX(DATE)

Re: MAX(DATE)

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Wed, 29 Mar 2000 22:30:14 +0100
Message-ID: <954365792.25709.2.nnrp-12.9e984b29@news.demon.co.uk>

From 8.1, timestamp should be treated
as a reserved word, along with a few other 'time' related words (can't remember them all off-hand, but timezone is another).

If you check standard.sql you will find lots of references to new time-based functions to bring Oracle up to scratch with the
SQL 92 standard in this area.

BTW -
>> BEGIN
>> SELECT data
>> INTO v_undoString
>> FROM CLIPBOARD WHERE
>> timestamp = (SELECT MAX(timestamp)
>> FROM CM_UNDO_CLIPBOARD
>> WHERE num = p_num AND OWNER = v_Name);
>> END;
Logically it seems that there ought to be a repeat of the

    WHERE num = p_num AND OWNER = v_Name for the outer-block to get meaningful results anyway.

--

Jonathan Lewis
Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk

Sybrand Bakker wrote in message
<954360061.6429.1.pluto.d4ee154e_at_news.demon.nl>...
>
><jeanch_at_my-deja.com> wrote in message news:8btkgn$h7g$1_at_nnrp1.deja.com...
>> Folks
>>
>> Can anybody help ?
>>
>> I am trying to get the latest (timewise) entry to the clipboard.
>>
>> when I run the below select using SQL it works
>> but not using PL/SQL;
>>
>> It seems like the MAX function does not
>> understand Date type.
>>
>> ....
>> v_undoString CLIPBOARD.DATA%TYPE DEFAULT NULL;
>> p_eid INTEGER;
>> v_name VARCHAR(30);
>>
>>
>> BEGIN
>> SELECT data
>> INTO v_undoString
>> FROM CLIPBOARD WHERE
>> timestamp = (SELECT MAX(timestamp)
>> FROM CM_UNDO_CLIPBOARD
>> WHERE num = p_num AND OWNER = v_Name);
>> END;
>>
>>
>> Table description
>> Name Null? Type
>> ------------------------------- -------- ----
>> num NUMBER(38)
>> TIMESTAMP DATE
>> OWNER VARCHAR2(100)
>> DATA VARCHAR2(2000)
>>
>>
>> Sent via Deja.com http://www.deja.com/
>> Before you buy.
>
>I would make sure using table aliases everywhere, pl/sql is very sensitive
>about scope.
>You also may want to check whether timestamp is a reserved word, to my best
>knowledge it isn't, but you never know.
>
>Hth,
>Sybrand Bakker, Oracle DBA
>
>
>
Received on Wed Mar 29 2000 - 15:30:14 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US