Identification Division.
Program-Id. last50s.
Environment Division.
Input-Output Section.
Data Division.
Working-Storage Section.
01 row pic S9(8) occurs 100.
77 anzahl pic S9(8).
77 von-lfdnr pic S9(8).
77 bis-lfdnr pic S9(8).
01 mysqlx-fetch-array occurs 100.
05 zeile pic X(80).
77 sqlx pic x(80).
01 this.
05 log pic x(80).
77 die-par pic x(80).
EXEC SQL INCLUDE SQLCA END-EXEC.
Procedure Division.
* Es werden die letzten 50 LOGIN angelistet
exec sql
Select max(lfdnr)
into :anzahl
from ta_logging
end-exec.
if sqlcode not= 0
display "<br> F E H L E R <BR>" sqlx "<br>"
display "<br>" sqlcode "<br>"
call MYsqlx-CLOSE
string "ABBRUCH: Fehler beim Lesen ta-logging für "
"Statuskontrolle (select #3)<br>"
into die-par
call die using die-par
end-if
if anzahl <= 50
move 0 to von-lfdnr
else
compute von-lfdnr = anzahl - 50
end-if
compute bis-lfdnr = 99
exec sql
Select *
into :mysqlx-fetch-array
from ta_logging
end-exec
if sqlcode not = 0 then
display "<br> F E H L E R <BR>" sqlx "<br>"
display "<br>" sqlcode "<br>"
string "ABBRUCH: Fehler beim Lesen ta-logging für "
"Statuskontrolle (select #4)<br>"
delimited by size into die-par
call die using die-par
else
perform until row not= mysqlx-FETCH-array(row, 1)
move row to log of this
add 1 to row
end-perform
end-if
End-Program last50s.
¤ Dauer der Verarbeitung: 0.51 Sekunden
¤
*© Formatika GbR, Deutschland