sql - How to stop or break (or raise error) execution of a script in Vertica -


in vertica, stop running script if condition meets. example, if script finds table has non-zero rows, rest of script should no longer run (that is, script should quit) , raise sort of error message (e.g., raiseerror in sql server).

i can think of wrapping rest of script case when, this:

case when (         select             count(*)                     my_table ) <= 0     'the rest of script here' else     'alert: make sure there nothing left in my_table' end 

but i'm wondering if there alternative (more standard) approach in vertica. thank in advance suggestions!

if wants know how force error in vertica using case when, 1 way:

select         case             when a.cnt = 0             'do something'             else 'do other thing'         end     (         select             count(*) cnt                     my_table) a; 

Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -