Created
January 24, 2023 23:23
-
-
Save jgoodie/9aa95cb925d48cdca8ec06a6b4395b3a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
sql = ["""SELECT SUM(MaxPerm)/(1024*1024*1024) FROM DBC.DiskSpaceV;""", | |
"""SELECT sum(maxperm)/(1024*1024*1024) FROM DBC.DiskSpaceV WHERE databasename='dbc';"""] | |
con = tdsql.connect(host=host, user=user, password=pw) | |
for s in sql: | |
cur = con.cursor() | |
cur.execute(s) | |
res = cur.fetchall() | |
print(f"{res[0][0]} GB") | |
con.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment