Created
August 23, 2022 13:02
-
-
Save plavjanik/e6dea253493c6d514e04f357514edba7 to your computer and use it in GitHub Desktop.
Connection to Python on z/OS
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
import ibm_db | |
from ibm_db_dbi import Connection | |
ibm_db_conn = ibm_db.pconnect( | |
"", | |
"", | |
"", | |
) | |
conn = Connection(ibm_db_conn) | |
cursor = conn.cursor() | |
result = cursor.execute( | |
"SELECT CREATOR, NAME FROM SYSIBM.SYSTABLES FETCH FIRST 10 ROWS ONLY" | |
) | |
for record in cursor.fetchall(): | |
print(record) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment