def run_test_023(self): conn = ibm_db.connect(config.database, config.user, config.password) server = ibm_db.server_info(conn) if (conn != 0): if (server.DBMS_NAME[0:3] == 'IDS'): stmt = ibm_db.column_privileges(conn, None, config.user, 'animals') elif (sys.platform == 'zos'): stmt = ibm_db.column_privileges(conn, None, config.user, 'ANIMALS') else: stmt = ibm_db.column_privileges(conn, None, None, 'ANIMALS') row = ibm_db.fetch_tuple(stmt) if row: print(row[0]) print(row[1]) print(row[2]) print(row[3]) print(row[4]) print(row[5]) print(row[6]) print(row[7]) ibm_db.close(conn) else: print(ibm_db.conn_errormsg()) print("Connection failed\n\n")
def run_test_023(self): conn = ibm_db.connect(config.database, config.user, config.password) server = ibm_db.server_info( conn ) if (conn != 0): if (server.DBMS_NAME[0:3] == 'IDS'): stmt = ibm_db.column_privileges(conn, None, config.user, 'animals') else: stmt = ibm_db.column_privileges(conn, None, None, 'ANIMALS') row = ibm_db.fetch_tuple(stmt) if row: print(row[0]) print(row[1]) print(row[2]) print(row[3]) print(row[4]) print(row[5]) print(row[6]) print(row[7]) ibm_db.close(conn) else: print(ibm_db.conn_errormsg()) print("Connection failed\n\n")
conn.openConnection() if conn.returnCode is True: dbConnection = conn.connectionID else: conn.closeConnection() exit(-1) # Attempt To Retrieve Information About All Of The Column Privileges That Have Been Defined For # The Table Specified print("Obtaining information about column privileges that exist for the " + columnName, end="") print(" column\nof the " + schemaName + "." + tableName + " table ... ", end="") try: resultSet = ibm_db.column_privileges(dbConnection, None, schemaName, tableName, columnName) except Exception: pass # If The Information Desired Could Not Be Retrieved, Display An Error Message And Exit if resultSet is False: print("\nERROR: Unable to obtain the information desired.\n") conn.closeConnection() exit(-1) # Otherwise, Complete The Status Message else: print("Done!\n") # As Long As There Are Records (That Were Produced By The ibm_db.column_privileges API), ... noData = False