Repository for M.A.I.L system's recording client.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

text.py 608B

12345678910111213141516171819202122232425262728
  1. import pymssql
  2. # DB 서버 주소
  3. server = '52.231.39.219'
  4. # 데이터 베이스 이름
  5. database = 'tsfmc_data'
  6. # 접속 유저명
  7. username = 'mc365'
  8. # 접속 유저 패스워드
  9. password = 'tkadbrdhmc1!'
  10. # MSSQL 접속
  11. cnxn = pymssql.connect(server , username, password, database)
  12. cursor = cnxn.cursor()
  13. # SQL문 실행
  14. cursor.execute("SELECT PSNAME FROM ADM010T WHERE PSENTRY='350003285';")
  15. print(cursor.fetchone()[0])
  16. # 데이타를 하나씩 Fetch하여 출력
  17. row = cursor.fetchone()
  18. while row:
  19. print(row[3], row[4], row[2])
  20. row = cursor.fetchone()
  21. break
  22. # 연결 끊기
  23. cnxn.close()