Dear Glenn
I notice is that the description of this IBM i service says :
[QUOTE]
When using
eof-delay, consider using a simple query to avoid blocking of rows. When rows are blocked for data transport efficiency, rows won't be returned until the block is full. Therefore, you should decide whether you favor data transport efficiency or moving events as soon as they occur.
[UNQUOTE]
So, I ask you to try appending this clause to the end of the SELECT statement to see if it helps return new history log entries or not : OPTMIZE FOR 1 ROW. This is to use the optimization goal of *FIRSTIO to avoid blocking of rows.
If this does not help, please try running the SELECT against HISTORY_LOG_INFO (with OPTIMIZE FOR 1 ROW) from "Run SQL Script" tool session to see if you get new history log entries or not? If so, at least you will know HISTORY_LOG_INFO service works fine.
------------------------------
Right action is better than knowledge; but in order to do what is right, we must know what is right.
-- Charlemagne
Satid Singkorapoom
------------------------------
Original Message:
Sent: Fri July 15, 2022 12:04 AM
From: Glenn Robinson
Subject: Logging ODBC activity
I'm running this query from a python script using pyodbc:
SELECT SYSLOG_EVENT, MESSAGE_TIMESTAMP, FROM_JOB, MESSAGE_ID, FROM_USER
FROM TABLE (QSYS2.HISTORY_LOG_INFO(START_TIME => '{start}',GENERATE_SYSLOG => 'RFC5424', EOF_DELAY => 5))
WHERE MESSAGE_ID IN ('CPF1124','CPF1164')
'''.format(start=startTime
)
This returns data and then seems to hang since i applied the latest V7R3 PTFs. I realise the EOF_DELAY will sit and wait until more data is available but I'm not seeing new history log entries being returned.
I use the odbc connection as follows:
# Run the SQL statement
def runSql(sqlstmt):
try:
conn = pyodbc.connect("DSN=*LOCAL;BlockFetch=0;BlockSizeKB=0K")
cur = conn.cursor()
cur.execute(sqlstmt)
# Retrieve each row of the data set
while True:
row = cur.fetchone()
if row == None:
break
yield row
except pyodbc.DatabaseError as err:
raise err
Is there a way to get debug info so i can see what it is, or isn't, doing.
Thanks
------------------------------
Glenn Robinson
------------------------------