0

I want to create a mobile app using python and kivy. I have an SQL server and a program which connects to it. However the form of a data which is fetched is not what i need

con=db.connect('Driver={SQL Server};'
                       'Server=dbname'
                       'Database=users;'
                       'Trusted_Connection=yes;')
cursor=con.cursor()
a=self.i.text
print(a)

cursor.execute('SELECT %s FROM users.dbo.users' %a)

res=cursor.fetchall()
print(str(res))


cursor.close()
con.close()
enter code here

In output I have : [(Decimal(9),)] How can I make it look like : 9 (Without data type etc)

eyllanesc
  • 190,383
  • 15
  • 87
  • 142
Margulanz
  • 1
  • 2
  • Have you trying to show res[0][0] ? I did’t have work with Python but in most programming languages we have too read result as table :). – Sanpas Jan 05 '19 at 13:34
  • https://stackoverflow.com/q/50862705/9940803 – Sanpas Jan 05 '19 at 13:43
  • Other link i think that explain : https://sqlchoice.azurewebsites.net/en-us/sql-server/developer-get-started/python/windows/step/2.html – Sanpas Jan 05 '19 at 13:45

0 Answers0