SQL tip: Update add instead of replace

A simple way to add to a database record instead of replacing it with Oracle:

UPDATE myTable SET textField = :text||textField WHERE ...

This comes in handy, when you have a form field, which can be empty, but should not overwrite an existing record when posted (This should also be easily adapted to other SQL dialects).

Leave a comment

Your email address will not be published. Required fields are marked *