CalmSoul
asked on
replace function in oracle
Hello Experts:
I two columns in ORA table with NAS path i.e.
I would like to replace it with new NAS path \\folder4\folder5\folder6\
output like this
Can somebody please assist with this update query?
Regards,
CS
I two columns in ORA table with NAS path i.e.
\\folder1\folder2\folder3\some file name1.doc
\\folder1\folder2\folder3\some file name2.doc
\\folder1\folder2\folder3\some file name3.doc
\\folder1\folder2\folder3\some file name4.doc
I would like to replace it with new NAS path \\folder4\folder5\folder6\
output like this
\\folder4\folder5\folder6\some file name1.doc
\\folder4\folder5\folder6\some file name2.doc
\\folder4\folder5\folder6\some file name3.doc
\\folder4\folder5\folder6\some file name4.doc
Can somebody please assist with this update query?
Regards,
CS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could also accomplish the above without the replace function -
update yourtable
set path = '\\folder4\folder5\folder6 '||substr( path,instr (path,'\', -1))
where path like '\\folder1\folder2\folder3 \%';
However, since you mention two columns, are you trying to replace the path in one column with the path from another column? If so, could you provide some sample data for both columns and your expected output?
update yourtable
set path = '\\folder4\folder5\folder6
where path like '\\folder1\folder2\folder3
However, since you mention two columns, are you trying to replace the path in one column with the path from another column? If so, could you provide some sample data for both columns and your expected output?
Open in new window