Home » Other » Client Tools » add fucntion to existing package (oracle 10g toad)
add fucntion to existing package [message #482458] Thu, 11 November 2010 14:33 Go to next message
infinitenumbers
Messages: 33
Registered: November 2010
Member
Hi,

I want to add my function to the existing package. Please let me know how do we do it..
Re: add fucntion to existing package [message #482459 is a reply to message #482458] Thu, 11 November 2010 14:36 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use Notepad or vi.

Regards
Michel

[Updated on: Thu, 11 November 2010 14:36]

Report message to a moderator

Re: add fucntion to existing package [message #482469 is a reply to message #482459] Thu, 11 November 2010 16:03 Go to previous messageGo to next message
infinitenumbers
Messages: 33
Registered: November 2010
Member
I dint get you.. Do we go to package manually in toad and add our procedure?

If so can we compile the newly addred fucntion alone?
Re: add fucntion to existing package [message #482472 is a reply to message #482469] Thu, 11 November 2010 16:32 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Package's start with the syntax
Create or replace

Whenever you run package code it create or replaces the entire package.
You can do the spec and the body seperately but that's it.
Re: add fucntion to existing package [message #482490 is a reply to message #482472] Fri, 12 November 2010 00:54 Go to previous messageGo to next message
saaya123
Messages: 76
Registered: September 2010
Member
Yes go to TOAD load the existing package spec and body.
Add new fucntion defination to package spec and compile
add function code to pacakge body. compile and fix syntax errors
Re: add fucntion to existing package [message #482491 is a reply to message #482472] Fri, 12 November 2010 01:15 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
From my point of view, there are two problems:
a) the OP doesn't know how to add a function to a package
b) the OP doesn't know how to use TOAD

Apart from other sources, this document describes how to use PL/SQL packages. In this case, package already exists; a new function should probably be added into both package specification and package body.

How to do that? In Schema Browser, go to "Packages". Find the package you are interested in. Double click it. A new, "Editor" window will open. It has two tabs: one for package specification, one for package body. Modify both of them. Then compile (using the "Execute as script" icon in the toolbar, or by pressing the F9 button) - specification first, body next. Both must be compiled without errors.

Right; a similar answer has already been provided (it took a lot of time to compose this message as I was doing something else in the meantime). However, I guess it won't do any harm if I post it.
Re: add fucntion to existing package [message #482498 is a reply to message #482491] Fri, 12 November 2010 01:59 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Right; a similar answer has already been provided (it took a lot of time to compose this message as I was doing something else in the meantime). However, I guess it won't do any harm if I post it.

Right, it is much easier to understand (at least for me that don't use toad). Wink

Regards
Michel
Re: add fucntion to existing package [message #482557 is a reply to message #482498] Fri, 12 November 2010 09:08 Go to previous messageGo to next message
infinitenumbers
Messages: 33
Registered: November 2010
Member
LittleFoot, Thanks for the detailed explanation. It was very useful. I am new to live environment of this technology, thats why I am asking kind of basic questions. Thanks everyone!
Re: add fucntion to existing package [message #482561 is a reply to message #482557] Fri, 12 November 2010 09:37 Go to previous message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
If you are new do NOT use TOAD, use SQL*Plus you will learn more and waste less time.
(At a pinch, you can use SQL Developer.)

Regards
Michel
Previous Topic: Spool Error in SQL*Plus
Next Topic: Can connect to SqlPlus but not through Toad
Goto Forum:
  


Current Time: Thu Apr 18 07:05:29 CDT 2024