Oracle 8 SQL: I do have data like “VTR 564-31 / V16 H12 W08 E19 L14” from which I want to trim the second part => “VTR 564-31”
According to this website I can use the rtrim function
rtrim(‘123000’, ‘0’); would return
‘123’
like this it works, but adapted to my use case, the following one does not trim at all? Do I have to escape the special character???
rtrim(‘VTR 564-31 / V16 H12 W08 E19 L14′,’ / ‘)
RTRIM removes characters specified in the second parameter from the end of the string specified in the first. Since the last character of ‘VTR 564-31 / V16 H12 W08 E19 L14’ is a ‘4’, which is not specified in the second parameter ‘ /’, there is nothing to trim.
It looks like you think it looks for the first occurence of ‘ /’ in the first string and removes everything from there on, but that’s not what it does.
For example:
RTRIM removed all the As and Bs from the end of the string.
Probably what you actually want is:
i.e. use INSTR to locate the position of ‘ / ‘ and then SUBSTR to get just the part of “yourstring” before that.