Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: MAX(DATE)
<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 - 13:38:52 CST
![]() |
![]() |