Skip to content

Instantly share code, notes, and snippets.

@narenaryan
Last active January 10, 2021 17:10
Show Gist options
  • Select an option

  • Save narenaryan/1de1de08a62932636e2794736a9c0e0b to your computer and use it in GitHub Desktop.

Select an option

Save narenaryan/1de1de08a62932636e2794736a9c0e0b to your computer and use it in GitHub Desktop.
cursor-illu
def main():
sql_query = 'SELECT * FROM actor WHERE first_name LIKE %s'
with connect(**config) as conn:
with conn.cursor("actor") as cur:
cur.execute(sql_query, ["John%"])
res = cur.fetchall()
print("Fetched records: %s" % res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment