http://www.perlmonks.org?node_id=874793


in reply to Re: Flexible Update SQL
in thread Flexible Update SQL

I had the same approach that you suggested but there is a problem with this... For example, if the phone and country are null, then the SQL that will be constructed will be:
UPDATE table SET city = 'test_city', FROM ...
This will be incorrect because of the comma after the 'test_city.'

I am not worried about SQL injection attack since this is really something internal and will not be exposed to the outside world.