title: Update query for cassandra using variable in python
body: <p>I am trying to run update query with variables. I am using <code>casandra-driver</code> as guided in datastax website.I am  using following script to connect cluster and update the values in table <code>ct_table</code>. </p>
  
  <pre><code>from cassandra.cluster import Cluster
  cluster = Cluster()
  session = cluster.connect('ct_keyspace')
  a=90
  session.execute("update ct_table set value=%d where attribute='CT'",(int(a)))
  result = session.execute("select * from ct_table where attribute='CT'")[0]
  print result.attribute, result.value
  </code></pre>
  
  <p>I am getting following error</p>
  
  <pre><code>Traceback (most recent call last):
    File "connection.py", line 7, in &lt;module&gt;
      session.execute("update ct_table set value=%d where attribute='CT'",(a))
    File "/usr/local/lib/python2.7/dist-packages/cassandra/cluster.py", line 1998, in execute
      return self.execute_async(query, parameters, trace, custom_payload, timeout, execution_profile, paging_state).result()
    File "/usr/local/lib/python2.7/dist-packages/cassandra/cluster.py", line 2035, in execute_async
      future = self._create_response_future(query, parameters, trace, custom_payload, timeout, execution_profile, paging_state)
    File "/usr/local/lib/python2.7/dist-packages/cassandra/cluster.py", line 2095, in _create_response_future
      query_string = bind_params(query_string, parameters, self.encoder)
    File "/usr/local/lib/python2.7/dist-packages/cassandra/query.py", line 823, in bind_params
      return query % tuple(encoder.cql_encode_all_types(v) for v in params)
  TypeError: 'int' object is not iterable
  </code></pre>
  
  <p>My table looks like this:</p>
  
  <pre><code>cqlsh:ct_keyspace&gt; describe ct_table
  
  CREATE TABLE ct_keyspace.ct_table (
      attribute text PRIMARY KEY,
      value int
  ) WITH bloom_filter_fp_chance = 0.01
      AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
      AND comment = ''
      AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
      AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
      AND dclocal_read_repair_chance = 0.1
      AND default_time_to_live = 0
      AND gc_grace_seconds = 864000
      AND max_index_interval = 2048
      AND memtable_flush_period_in_ms = 0
      AND min_index_interval = 128
      AND read_repair_chance = 0.0
      AND speculative_retry = '99.0PERCENTILE';
  </code></pre>
  
  <p><code>value</code>  is defined in the table as <code>int</code> . I suspect I am formatting the string for update query incorrectly.</p>