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

Home -> Community -> Usenet -> c.d.o.tools -> Re: PL/SQL & sysdate

Re: PL/SQL & sysdate

From: Eddie <edawad_at_hotmail.com>
Date: 2000/06/26
Message-ID: <PVQ55.1202$8Z6.190622@paloalto-snr1.gtei.net>#1/1

The following works fine:

declare

   thisyear number;
begin

   select to_number(to_char(sysdate, 'YYYY'))    into thisyear from dual;
   dbms_output.put_line(to_char(thisyear)); end;

Eddie.

Frans Hovenkamp <Dieze_at_popin.nl> wrote in message news:8j70t6$bt2$1_at_porthos.nl.uu.net...
> try this:
> select to_number(to_char(sysdate, 'YYYY'))
> into :thisyear from dual;
>
> Frans
>
>
> blank214_at_my-deja.com heeft geschreven in bericht
> <8ivke8$s10$1_at_nnrp1.deja.com>...
> >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.
>
>
Received on Mon Jun 26 2000 - 00:00:00 CDT

Original text of this message

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