Re: PL/SQL & sysdate
From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: 2000/06/23
Message-ID: <3953458E.1FBD_at_yahoo.com>#1/1
Date: 2000/06/23
Message-ID: <3953458E.1FBD_at_yahoo.com>#1/1
blank214_at_my-deja.com wrote:
>
> I want to get the current year from the database & convert it to a
> number. The PL/SQL block compiles, but hangs when I try to execute it.
> The following is the problem statement:
>
> select to_number(to_char(sysdate, 'YYYY'))
> into thisyear from dual;
>
> What am I doing wrong?
>
> Thanks in advance - Jennifer
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
That should work, but try this
declare
x number(4);
begin
x := to_number(to_char(sysdate, 'YYYY'));
end;
HTH
-- =========================================== Connor McDonald http://www.oracledba.co.uk We are born naked, wet and hungry...then things get worseReceived on Fri Jun 23 2000 - 00:00:00 CEST