Skip to content

Instantly share code, notes, and snippets.

@ryandotclair
Created December 10, 2015 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryandotclair/db87b453bf08b334e80e to your computer and use it in GitHub Desktop.
Save ryandotclair/db87b453bf08b334e80e to your computer and use it in GitHub Desktop.
Record_exists.py
def record_exists():
cursor = db_connection.cursor()
SQL = "SELECT EXISTS (SELECT key FROM reporterschema.main WHERE date = %s AND sn = %s AND sg = %s)"
DATA = (timestamp, symmetrix_id, storage_group_id)
cursor.execute(SQL, DATA)
if cursor.fetchall()[0][0]:
return True
else:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment