Question

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.

Was it helpful?

Solution

You're going to kick yourself:

CREATE OR REPLACE VIEW ...

Details here. ;-)

OTHER TIPS

CREATE OR REPLACE VIEW <view name>
AS
<your select expression goes here>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top