Home » SQL & PL/SQL » SQL & PL/SQL » create or replace v/s create
create or replace v/s create [message #237283] Mon, 14 May 2007 01:36 Go to next message
srivaths
Messages: 60
Registered: June 2005
Location: France
Member

what is the use of REPLACE key word in CREATE OR REPLACE syntax
apart from replacing the existing object. Does it have any other function other than that?



Re: create or replace v/s create [message #237289 is a reply to message #237283] Mon, 14 May 2007 01:41 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No.
It just indicates to Oracle that if the object already exists this is not an error and we want to overwrite it.

In addition, the documentation says (for instance, for FUNCTION):
Quote:
Specify OR REPLACE to re-create the function if it already exists. Use this clause to change the definition of an existing function without dropping, re-creating, and regranting object privileges previously granted on the function. If you redefine a function, then Oracle Database recompiles it.

Regards
Michel
Re: create or replace v/s create [message #237290 is a reply to message #237289] Mon, 14 May 2007 01:49 Go to previous message
srivaths
Messages: 60
Registered: June 2005
Location: France
Member

Thanks Michel for the info.

Srivaths
Previous Topic: alter table move
Next Topic: Tree of Joins ......?
Goto Forum:
  


Current Time: Tue Dec 06 16:11:27 CST 2016

Total time taken to generate the page: 0.11436 seconds