Files
ordinaceprojekt/Medicus/MedicusWithClaude/read_last_dekurs.py
T
Vladimir Buzalka a9c143ba24 notebookvb
2026-04-29 06:51:47 +02:00

23 lines
582 B
Python
Raw 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()