Multiple Drop and Create View Statements
Posted in 2000
Hello,
I'm new to writing Informix SQL and would appreciate any assistance you can
offer. My problem is,
I am writing a script, which will DROP and CREATE multiple views (see
example below). The DROP view does not always exist but I want to include
the DROP so that if it does exist I can keep everything clean. The problem
is if the DROP view doesn't exist the script stops with a file not found
which I realize. My understanding is that there is another command I can use
to keep the script processing even if a DROP view doesn't exist. I hope I'm
explaining this well enough for someone to assist me.
Thanks!
DROP VIEW vw_gapaccrcodemph;
CREATE VIEW vw_gapaccrcodemphAS SELECT *
FROM apaccrcode
WHERE apaccrcode.company in ('355', '360', '364', '366');
DROP VIEW vw_gapapprovalmph;
CREATE VIEW vw_gapapprovalmphAS SELECT *
FROM apapproval
WHERE apapproval.company in ('355', '360', '364', '366');
DROP VIEW vw_gapauditmph;
CREATE VIEW vw_gapauditmphAS SELECT *
FROM apaudit
WHERE apaudit.company in ('355', '360', '364', '366');