Can you "change" the data in a view?

815 views Asked by At

Our company for years put an & in the customer ID's. Now we're doing this cloud thing and the &'s are causing problems.

I've got this view that I need to change the '&' to a '_' in the customerID field.

Is there a way to this this?

Thanks,

Onyx

2

There are 2 answers

0
John Joseph On BEST ANSWER

The following SQL statement replaces the '&' with an underscore '_'...

    select replace('A&C','&','_')

In your case, you'd have an expression like...

    select replace([customerID],'&','_')
1
LONG On

you CANNOT change the table or data value directly from view because view is a result set from multiple tables. And it is kind of dynamic, which means you have an option to change the data from specific table first before you could see the changes from the view. Use Update table Set col = replace (col,'&','_') Where...