Re: PL/SQL Procedure Need Help seriously
"Matt Turner" <[email protected]> Thu, 24 Apr 2003 10:08:05
| Newsgroups | gmane.comp.db.oracle.devel |
|---|---|
| Message-ID | <LYRIS-1796914-958217-2003.04.24-09.47.13--gcdod-oracle#[email protected]> |
> 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 protected].