RE: PL/SQL Procedure Need Help seriously

"Harmon, David" <[email protected]> Wed, 23 Apr 2003 13:24:06 -0500
Newsgroups gmane.comp.db.oracle.devel
Message-ID <LYRIS-1796914-957428-2003.04.23-19.19.53--gcdod-oracle#[email protected]>
That's true, Ivan.  It's by definition.  Procedures perform processes =
and functions return values.

lower(), to_date().....

those are functions, not procedures.

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Wednesday, April 23, 2003 1:01 PM
To: Oracle
Subject: [oracle] RE: PL/SQL Procedure Need Help seriously



Leonard,

Could you please point me to the documentation that states that a =
procedure
is not meant to return a calculated value.

So are you saying that if you need more then one calculated value =
returned
you would create two functions instead of one procedure??

- Ivan



                                                                         =
                                                             =20
                      "Leonard Anukam"                                   =
                                                             =20
                      <leonardanukam@ho        To:       "Oracle" =
<[email protected]>                                               =20
                      tmail.com>               cc:                       =
                                                             =20
                                               Subject:  [oracle] RE: =
PL/SQL Procedure Need Help seriously                            =20
                      04/23/2003 01:57                                   =
                                                             =20
                      PM                                                 =
                                                             =20
                      Please respond to                                  =
                                                             =20
                      "Oracle"                                           =
                                                             =20
                                                                         =
                                                             =20
                                                                         =
                                                             =20





You better use function to return a value. Procedure is not meant to =
return
a calculated values, but to displace information
Leonard
As water reflects a face so do a man's heart reflects the man



From: "Calhoun, Bob"
Reply-To: "Oracle"
To: "Oracle"
Subject: [oracle] RE: PL/SQL Procedure Need Help seriously
Date: Wed, 23 Apr 2003 13:32:05 -0400

this variation works

create or replace procedure calc_age
( birth_date in date)
is
g_age number;
BEGIN
dbms_output.enable;
g_age :=3D 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 :=3D (sysdate - mybirthdate)/365
:g_age :=3D 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%%.
Add photos to your messages with  MSN 8.  Get 2 months FREE*.

---
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=20
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].