How to use parameter values in embedded sql query in python? -


i getting error when trying execute query or when works not take value of date in account. can tell me how write correctly?i pass value of date when call function.

def get_value(connection,date):    query =  """select *                tests                date > 'date';""" 

what query comparing value in date column string 'date'; parameter you're passing method not being considered @ all.

what need concatenating query parameter pass, like

def get_value(connection,date):    query =  """select *                tests                date > '{}';""".format(date) 

this make python replace {} value of date variable @ runtime.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -