>python3 exceldbtest.py
SQLConnect(2, database, -3, user, -3, password, -3)
Exec successfulTraceback (most recent call last):
File "exceldbtest.py", line 17, in <module>
print('Exec successful')
Exception: Error occurred in SQL Call Level Interface SQLSTATE=HY009 SQLCODE=-99999
Python Script:
import xlsxwriter
import ibm_db
# Create a workbook and add a worksheet.#wb = xlsxwriter.Workbook('db2test.xlsx')
try: connection = ibm_db.connect('database','user','password')except: msg = ibm_db.conn_errormsg() print(msg)if connection: sql = 'select * from AULT4F2dev.app52 fetch first 10 rows only' stmt = ibm_db.exec_immediate(connection, sql)
if stmt: print('Exec successful') #print(ibm_db.num_fields(result)) #i = 0 #row = ibm_db.fetch_row(result) #while (row): #print(ibm_db.result(result,i)) # i += 1 # row = ibm_db.fetch_row(result) else: print(ibm_db.stmt_errormsg())else: print('Connection failed')
#ibm_db.free_result(result) ibm_db.free_result(stmt)ibm_db.close(connection)#wb.close()>python3 exceldbtest.py
print('Exec successful')
Python Script:
--
You received this message because you are subscribed to the Google Groups
"ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to ibm_db+un...@googlegroups.com.
To post to this group, send email to ibm...@googlegroups.com.
Visit this group at https://groups.google.com/group/ibm_db.
For more options, visit https://groups.google.com/d/optout.