Home » SQL & PL/SQL » SQL & PL/SQL » difference between "Create and replace", and "create"
difference between "Create and replace", and "create" [message #342956] Mon, 25 August 2008 11:27 Go to next message
gautamvv
Messages: 254
Registered: June 2005
Senior Member
what is the difference between

"create and replace procedure xyz.."

and "create procedure xyz.."

I know in the first case, if the procedure exists, it is dropped
and then recreated....but apart from that, what exactly happens
in the background? i know a row in user_objects is created...
but apart from these, what else ?

something to do with the grants ? i mean, is there no need to
grant seperately on this procedure if we go for create or replace?

Re: difference between "Create and replace", and "create" [message #342958 is a reply to message #342956] Mon, 25 August 2008 11:34 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
but apart from that, what exactly happens
in the background?

One is insert and the other one is update.

Quote:
i know a row in user_objects is created...
but apart from these, what else ?

Not really in user_objects but sys.obj and many many other tables.

Quote:
something to do with the grants ? i mean, is there no need to
grant seperately on this procedure if we go for create or replace?

"create or replace" keeps the grants done, "drop + create" will lose them?

Regards
Michel
Re: difference between "Create and replace", and "create" [message #342963 is a reply to message #342956] Mon, 25 August 2008 12:01 Go to previous message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Quote:
what is the difference between

"create and replace procedure xyz.."

and "create procedure xyz.."

Well, the first one would be syntactically incorrect:

CREATE OR REPLACE
Previous Topic: getting counts of multiple tables with one SQL stmt
Next Topic: SQL Query Issue
Goto Forum:
  


Current Time: Fri Dec 02 14:09:31 CST 2016

Total time taken to generate the page: 0.09384 seconds