Files
medicus/MedicusWithClaude/read_last_dekurs.py
2026-03-18 07:13:47 +01:00

23 lines
582 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""read_last_dekurs.py jednorázový skript: vypíše obsah posledního DEKURS záznamu pro Buzalka"""
import fdb
conn = fdb.connect(
dsn=r'localhost:c:\medicus 3\data\medicus.fdb',
user='SYSDBA', password='masterkey', charset='win1250'
)
cur = conn.cursor()
cur.execute("""
SELECT FIRST 1 ID, DATUM, CAS, CHAR_LENGTH(DEKURS), DEKURS
FROM DEKURS
WHERE IDPAC = 9742
ORDER BY ID DESC
""")
row = cur.fetchone()
idek, datum, cas, delka, obsah = row
print(f"ID={idek} datum={datum} cas={cas} délka={delka} B")
print("=" * 60)
print(obsah)
conn.close()