RE: PL/SQL Procedure Need Help seriously

"Shijie" <[email protected]> Thu, 24 Apr 2003 21:01:36 +0800
Newsgroups gmane.comp.db.oracle.devel
Message-ID <LYRIS-1796914-958445-2003.04.24-13.59.35--gcdod-oracle#[email protected]>
Dear Sir/Madam,
Thanks brother.

Yours Sincerely,
Koh Sze Jie
Administrator B01
Bots.Com.Sg
www.bots.com.sg
Your satisfaction is our concern
----- Original Message -----
From: "Calhoun, Bob" <[email protected]>
To: "Oracle" <[email protected]>
Sent: Thursday, April 24, 2003 1:32 AM
Subject: [oracle] RE: PL/SQL Procedure Need Help seriously


> this variation works
>
> create or replace procedure calc_age
> ( birth_date in date)
>    is
>     g_age number;
> BEGIN
>     dbms_output.enable;
>     g_age := round((sysdate - birth_date)/365,0);
>     dbms_output.put_line( g_age);
> END;
> /
>
> SQL> set serveroutput on
> SQL> exec calc_age('14-nov-1984')
> SQL> 18
> SQL> exec calc_age('01-jul-1979')
> SQL> 24
>
>
> -----Original Message-----
> From: koh sze jie [mailto:[email protected]]
> Sent: Wednesday, April 23, 2003 2:30 PM
> To: Oracle
> Subject: [oracle] PL/SQL Procedure Need Help seriously
>
>
> this is my procedure whereby you input a date value into the procedure to
> calculate ur age.
>
> variable g_age number
> create or replace procedure cal_age
> ( mybirthdate in date
>   myage out number )
> is
> begin
> myage := (sysdate - mybirthdate)/365
> :g_age := myage;
> end;
> print g_age
>
> Here is my problem
> how do i input a date value into my procedure..
>
> i tried
> execute cal_age('14-NOV-84');
> but it return an error and i know it wrong as well.
> but i cant embed a to_date function within the parenthesis.
>
> so any1 please help ?
>
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or
> to unsubscribe send a blank email to %%email.unsub%%.
>
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or
> to unsubscribe send a blank email to %%email.unsub%%.
>
>



---
Change your mail options at http://p2p.wrox.com/manager.asp or 
to unsubscribe send a blank email to [email protected].