Re: PL/SQL Procedure Need Help seriously

"Shijie" <[email protected]> Thu, 24 Apr 2003 21:07:17 +0800
Newsgroups gmane.comp.db.oracle.devel
Message-ID <LYRIS-1796914-958448-2003.04.24-14.03.50--gcdod-oracle#[email protected]>
Dear Sir/Madam,
Thanks matt, i am kinda slow :D

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


> > this is my procedure whereby you input a date value into the procedure 
> to 
> c> alculate ur age.
> 
> > variable g_age number
> c> reate or replace procedure cal_age
> (>  mybirthdate in date 
>  >  myage out number )
> i> s
> b> egin
> m> yage := (sysdate - mybirthdate)/365
> :> g_age := myage;
> e> nd;
> p> rint g_age
> 
> > Here is my problem
> h> ow do i input a date value into my procedure..
> 
> > i tried
> e> xecute cal_age('14-NOV-84');
> b> ut it return an error and i know it wrong as well.
> b> ut i cant embed a to_date function within the parenthesis.
> 
> > so any1 please help ?
> 
> > 
> 
> Can I suggest you use 
> 
> 
>  months_between(sysdate, :birth_date )  / 12
> 
> rather than /365 as it months_between will take into account any
> leap years....
> 
> ---
> 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].