0
SELECT PATH AS STRUCTURE
FROM OBJ_RESOURCE  
WHERE PATH LIKE '%Small Business%'

STRUCTURE

\Small Business\Organisation / IT / Logistik\Organisation /Governance\Person\Prozess-User

I get above data but i need the second one only with slashs:

STRUCTURE

/Small Business/Organisation / IT / Logistik/Organisation / Governance/Person/Prozess-User

âńōŋŷXmoůŜ
  • 6,942
  • 1
  • 15
  • 28
anna
  • 9
  • 5

1 Answers1

0

Edit: Use replace function. Replace forward slash first then replace 2x backslash with one backslash. See demo here: http://sqlfiddle.com/#!18/be5b0/14

SELECT  REPLACE(REPLACE(PATH, '/', '\'), '\\','/')  AS STRUCTURE 
from OBJ_RESOURCE;

Result: /Small Business/Organisation / IT / Logistik/Organisation /Governance/Person/Prozess-User

=======

The problem is when you insert the data into the table, there are missing backslash. See sample below:

create table OBJ_RESOURCE (path varchar(100));
insert into OBJ_RESOURCE values('\\Small Business\\Organisation \/ IT \/ Logistik\\Organisation \/Governance\\Person\\Prozess-User');
âńōŋŷXmoůŜ
  • 6,942
  • 1
  • 15
  • 28
  • i only need slash no backslash – anna Apr 16 '18 at 14:35
  • you put in your post that you want the first STRUCTURE data: \Small Business\Organisation / IT / Logistik\Organisation /Governance\Person\Prozess-User. Please tell us what data you want to see. – âńōŋŷXmoůŜ Apr 16 '18 at 14:40
  • /Small Business/Organisation / IT / Logistik/Organisation / Governance/Person/Prozess-User only with slash – anna Apr 16 '18 at 14:42
  • @âńōŋŷXmoůŜ, anna wants slashes, not backslahes. http://sqlfiddle.com/#!18/7beb8/3 – pawamoy Apr 16 '18 at 14:57