Created
December 10, 2015 04:14
-
-
Save ryandotclair/db87b453bf08b334e80e to your computer and use it in GitHub Desktop.
Record_exists.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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