-1

I am extracting data from oracle table to a text file and i see in the field3, i am getting null byte at the end of the field3 eg., SV^@. I am expecting only SV but ^@ is getting appended. Trim function doesnt seems to help.

Select field1,field2,trim(field3),field4
from table1 

**Sample Data:**
```none
898698797,20205,SV^@,0119
898698797,20445,SV^@,0181
898698797,20775,SV^@,0141
898698797,20277,SV^@,0115
kumar007
  • 1
  • 4

2 Answers2

0

If you want to trim a trailing null byte from a value, use RTRIM(..., CHR(0)).

Luke Woodward
  • 63,336
  • 16
  • 89
  • 104
0

I'm not sure how/when the translation from nullbyte to ^@ is happening. You can try Luke's suggestion; if that doesn't work, you could also try

Select field1,field2,replace(field3, '^@'), field4 from table1
TheMouseMaster
  • 298
  • 1
  • 10