Add MedicusWithClaude project - DB exploration scripts and notes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
25
MedicusWithClaude/sample_dekurs2.py
Normal file
25
MedicusWithClaude/sample_dekurs2.py
Normal file
@@ -0,0 +1,25 @@
|
||||
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, DEKURS
|
||||
FROM DEKURS
|
||||
WHERE DEKURS IS NOT NULL
|
||||
ORDER BY DATUM DESC
|
||||
""")
|
||||
row = cur.fetchone()
|
||||
text = row[2].read() if hasattr(row[2], 'read') else row[2]
|
||||
if isinstance(text, bytes):
|
||||
text = text.decode('windows-1250', errors='replace')
|
||||
|
||||
print(f"ID={row[0]} DATUM={row[1]}")
|
||||
print(f"Délka: {len(text)} znaků")
|
||||
print("\n--- CELÝ TEXT ---")
|
||||
print(text)
|
||||
|
||||
conn.close()
|
||||
Reference in New Issue
Block a user