0

I have a string in oracle column example emp.id=100&empHelper.userTab=2 I want to use REPLACE function to replace '&empHelper.userTab=2' with empty string.

& symbol is creating problem , I want to use escape char to consider '&empHelper.userTab=2' as text to replace in replace function instead of using set define off .

Vivek Panday
  • 1,426
  • 2
  • 16
  • 34
  • Please show us your current query. – Tim Biegeleisen Jan 24 '17 at 06:49
  • 1
    What is the "problem" you have? If you are using `sqlplus` you need to run `set define off` otherwise the `&` is used for parameters. –  Jan 24 '17 at 06:54
  • @a_horse_with_no_name Thanks, you just answered the question. – Tim Biegeleisen Jan 24 '17 at 06:54
  • I am executing UPDATE EMPLOYEE SET URL= REPLACE(URL, '&empHelper.userTab=2', '') where application_id = 'manager'; Its taking &empHelper as input parameter. – Vivek Panday Jan 24 '17 at 06:56
  • Don't post code or additional information in comments. [edit] your question (and read: http://stackoverflow.com/help/formatting to understand how you can format your code) –  Jan 24 '17 at 06:57
  • Just don't use the ampersand, use CHR function instead. This will avoid needing to set define off. REPLACE(myvar,CHR(38),'_') – Marco Polo Jan 25 '17 at 14:31

0 Answers0