I am using pyodbc to save data in Microsoft SQL Server.
I 3 string variables, user_first_name, user_last_name and profile_photo_path
user_first_name = 'Shams'
user_last_name = 'Nahid'
file_name = 'my_profile_photo_path'
Now when I try to save data using
cursor.execute(f'''
                    INSERT INTO pyUser.dbo.user_information (first_name, last_name, profile_photo_path)
                    VALUES
                    ({user_first_name}, {user_last_name}, {file_name})
                    ''')
I get the following error
Invalid column name \'Shams\'.
Invalid column name \'Nahid\'.
The multi-part identifier "directory.PNG" could not be bound.
But instead of the variable, if I put the hardcoded string
cursor.execute('''
                    INSERT INTO pyUser.dbo.user_information (first_name, last_name, profile_photo_path)
                    VALUES
                    ('my_user_first_name', 'my_user_last_name', 'my_file_name')
                    ''')
Then the query shows no error.
I checked the variable type, user_first_name, user_last_name and file_name, all are <class 'str'>
How can I put the variable in the query?


