I'm trying to pick a random item from an array while performing an update in Oracle. What is the easiest way to achieve this?
I want something like this:
DECALRE ARRAY items = ('item1', 'item2', 'item3')
update table set field = items(TRUNCT(DBMS_RANDOM.value(1,3)))
that way a random value from the list is inserted in the field for each record that is being updated.