views:

171

answers:

2

How do I create a view only if it doesn't exist. If it does exist, I want to drop the view and redefine it. I also want no warnings or errors.

+5  A: 

You're going to kick yourself:

CREATE OR REPLACE VIEW ...

Details here. ;-)

T.J. Crowder
darn, you beat me to it and i didn't get a notification an answer was posted already. so +1 from me.
Roland Bouman
A: 
CREATE OR REPLACE VIEW <view name>
AS
<your select expression goes here>
Roland Bouman