I am trying to compile an SQL Update query from values in a PySimpleGUI fields. I am using concatenated f-strings to do this.
If any field is blank, one must substitute 'DEFAULT' as the value. To do that I tried to use a conditional_expressions, such as:
update_cust_qry = "UPDATE `d_base`.`Customers` SET " +\
f"Contact = '{'DEFAULT' if values['_CONTACT_'] = '' else values['_CONTACT_']}'," + \
f"WHERE Customer = '{values['_CUSTOMERS_'][0]}'"
Unfortunately, Python-3 declared such a construct as a syntax-error.
Can you please show me a correct way to do that?
Many, many thanks
Meir