Conditional Drop View

Posted by sjellin.dovetail on 06-Feb-2019 06:59

(Sorry if this isn't the right Forum).

OpenEdge 11.6 - to ease SQL view creation / modification with deployments I've been trying to figure out how to conditionally delete a View IF it exists as not all views are at all clients at any given time (we would like to have a standard script to delete specific views, reload them - and leave any custom views that are at the client alone).

I've tried if (exists (select * from .sysview.. )) and that didn't work (The select on its own works).  

Any help would as always be greatly apreciated.

All Replies

Posted by Tinco on 06-Feb-2019 08:29

Hi,

In the java code I wrote for the following article:

knowledgebase.progress.com/.../java-program-to-create-SQL-views-of-non-empty-PUB-tables-having-the-same-default-display-column-order-as-in-4GL

I also did a SQL query on PUB._Sysviews to determine if a view already existed and then did a SQL 'DROP VIEW myViews.theViewName' to delete the SQL view before recreating the SQL view with a 'CREATE VIEW myViews.theViewName AS ...' later on in the same java code.

Ii should be possible to reuse that part of the java code.

Hopes this help,

Tinco

This thread is closed