Showing posts with label retrieves. Show all posts
Showing posts with label retrieves. Show all posts

Saturday, 27 February 2016

How to Replace a Substring in Oracle SQLIn Feburary 2016 27,

In Feburary 2016 27,
Sign in to SQLPlus.
Type a 'select' command using the 'replace' function and press 'enter':select string_column, replace(string_column, 'co.', 'company') from string_table;This command retrieves the 'string_column' twice so that the user can see a before-and-after representation of the data. In this case, 'co.' is the target and 'company' is the replacement.
Inspect the results to see the replacement. If the 'string column' contained 'abc co.', it should now be converted to 'abc company.'
Translate Function
Sign in to SQLPlus.
Type a 'select' command using the 'translate' function and press 'enter':select string_column, translate(string_column, 'abc', 'xyz') from string_table;This command retrieves the 'string_column' twice so that the user can see a before-and-after representation of the data. The phrase 'abc' is the 'fromlist', and 'xyz' is the 'tolist.'
Inspect the results to see the replacement. If 'string column' contained 'abc co.', it is converted to 'xyz zo.'
In Feburary 2016 27,