title: Insert variable Data into SQL server using python
body: <pre><code>def LiraRateApiCall():
  R = requests.get(url)
  timestamp = R.json()['buy'][-1][0]/1000
  format_date = '%d/%m/%y'
  date = datetime.fromtimestamp(timestamp)
  buyRate = R.json()['buy'][-1][1]
  print(date.strftime(format_date))
  print(buyRate)
  
  
  #ADDDING TO SQL SERVER
  conn = odbc.connect(&quot;Driver={ODBC Driver 17 for SQL Server};&quot;
                      'Server=LAPTOP-36NUUO53\SQLEXPRESS;'
                      'Database=test;'
                      'Trusted_connection=yes;')
  cursor = conn.cursor()
  cursor.execute('''
                  INSERT INTO Data_table (Time1,Price)
                  VALUES
                  ('date',140),
                  ('Date2' , 142)
                  ''')
  conn.commit()
  cursor.execute('SELECT * FROM Data_table')
  
  for i in cursor:
      print(i)
  </code></pre>
  <p>How do i pass the variables date and buy rate to the table instead of putting in values liek i did (i put in'date' , 140 for example but i want to pass variables not specific values)</p>