Hi,
I have a Python Startup Script using cx_Oracle library, which calls an Oracle Procedure returning a count value. If the count is greater than 0 then I want to stop the Workspace running.
Wondering how do I go about terminating the Workspace?
Thanks!
import cx_Oracle
# Connect to Oracle and Query the table
try:
connection = cx_Oracle.connect('user/pwd@orcl')
cursor = connection.cursor()
result = cursor.var(cx_Oracle.NUMBER)
cursor.callproc('check_valid_dataset', (101,result))
if result.getvalue() > 0.0:
print 'Terminating: Some datasets are not available'
cursor.close()
connection.close()
except:
print 'ERROR - Python startup script could not connect to database'