Home » SQL & PL/SQL » SQL & PL/SQL » procdure and function diff for this scenario (oracle 9i,widows xp)
procdure and function diff for this scenario [message #329045] Mon, 23 June 2008 23:00 Go to next message
mm_kanish05
Messages: 493
Registered: January 2007
Location: Chennai
Senior Member

Hi

I am creating procedure and function like below.

          Create or Replace incrementpro(a in number,b out number) is
    begin
        b := a+1;
    end;
   


function


          Create or Replace incrementfun(a in number,b out number) is
    begin
        b := a+1;
    end;
   


both will be successfully created.

For to get the result of procedure i wrote like below

 var x number
 exec incrementpro(1,:x)
 print x


to achieve the same in function what should i want to do.


Re: procdure and function diff for this scenario [message #329047 is a reply to message #329045] Mon, 23 June 2008 23:07 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & follow Posting Guidelines as stated in URL above

The PL/SQL Reference Manual can be found at http://tahiti.oracle.com
Re: procdure and function diff for this scenario [message #329055 is a reply to message #329045] Mon, 23 June 2008 23:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
both will be successfully created.

This is wrong, both will give you an invalid syntax error.

SQL Reference
PL/SQL User's Guide and Reference

Regards
Michel
Re: procdure and function diff for this scenario [message #329058 is a reply to message #329045] Mon, 23 June 2008 23:30 Go to previous messageGo to next message
mm_kanish05
Messages: 493
Registered: January 2007
Location: Chennai
Senior Member

Tell me, in what way, michel. Both was created sucessfully in my systems.

Tell me your Side.

Kanish


Re: procdure and function diff for this scenario [message #329060 is a reply to message #329045] Mon, 23 June 2008 23:33 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Both was created sucessfully in my systems
Use sqlplus along with CUT & PASTE to post proof!
You have syntax errors.

[Updated on: Mon, 23 June 2008 23:34] by Moderator

Report message to a moderator

Re: procdure and function diff for this scenario [message #329063 is a reply to message #329045] Mon, 23 June 2008 23:46 Go to previous messageGo to next message
mm_kanish05
Messages: 493
Registered: January 2007
Location: Chennai
Senior Member

Sorry Michel it is my typographical error that is missing of procedure and function.

create or replace procedure incrementpro(a in number,b out number) 
.....


create or replace function incrementfun(a in number,b out number)
.....


ok now u tell me what way i can acces incrementfun. thru plsql.

thanks and sorry Michel.

kanish

[Updated on: Mon, 23 June 2008 23:50]

Report message to a moderator

Re: procdure and function diff for this scenario [message #329064 is a reply to message #329045] Mon, 23 June 2008 23:48 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It appears you need remedial training in CUT & PASTE.
Re: procdure and function diff for this scenario [message #329066 is a reply to message #329045] Mon, 23 June 2008 23:56 Go to previous messageGo to next message
mm_kanish05
Messages: 493
Registered: January 2007
Location: Chennai
Senior Member

Hi michel i accept my mistake.

Tell me now what way i can use the increment in function in plsql.

give me an example.


thanks
Re: procdure and function diff for this scenario [message #329069 is a reply to message #329045] Tue, 24 June 2008 00:04 Go to previous messageGo to next message
flyboy
Messages: 1903
Registered: November 2006
Senior Member
Now you cut it to early. The function header shall be
create or replace function incrementfun(a in number,b out number)
return <datatype>
. The code for its call depends on the missing part.

I just wonder, where you obtained the code for calling procedure, but firstly you shall understand it. You may find the explanation in links posted by anacedent and Michel. Then it will not be difficult for you to adjust it for function.
Re: procdure and function diff for this scenario [message #329075 is a reply to message #329045] Tue, 24 June 2008 00:20 Go to previous messageGo to next message
mm_kanish05
Messages: 493
Registered: January 2007
Location: Chennai
Senior Member

Ok fly boy. Tell me the answer for the earlier quetions.

kanish
Re: procdure and function diff for this scenario [message #329079 is a reply to message #329075] Tue, 24 June 2008 00:37 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
Tell me the answer for the earlier quetions

The answer was given, just read the posts AND the documentation.

Regards
Michel
Re: procdure and function diff for this scenario [message #329097 is a reply to message #329079] Tue, 24 June 2008 01:50 Go to previous messageGo to next message
panyam
Messages: 146
Registered: May 2008
Senior Member

Hi

You can Find the solution and related information in.

http://www.orafaq.com/forum/?t=msg&th=47203/0/
Re: procdure and function diff for this scenario [message #329123 is a reply to message #329045] Tue, 24 June 2008 03:29 Go to previous message
mm_kanish05
Messages: 493
Registered: January 2007
Location: Chennai
Senior Member

thank u

kanish
Previous Topic: paramertised cursor
Next Topic: Prob : Whats the difference?
Goto Forum:
  


Current Time: Fri Feb 14 15:50:06 CST 2025