• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Oracle double byte space...

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Oracle double byte space...

    Any Oracle SQL genius able to tell me how I can trim the trailing double byte spaces from fields?


    rtrim(field) or rtrim(field, ' ') or rtrim(field, '<copy of double space character')
    none of those work.
    …Maybe we ain’t that young anymore

    #2
    TRIM function

    Have you tried using trailing in conjunction with Trim?
    Can't have a go fo you now, as I'm on the train

    The invoice is in the post
    The Chunt of Chunts.

    Comment


      #3
      Originally posted by MrMarkyMark View Post
      TRIM function

      Have you tried using trailing in conjunction with Trim?
      Can't have a go fo you now, as I'm on the train

      The invoice is in the post
      The default mode is Both so I don't Trailing helps.

      More serious answer are you running this from a console or from a stored procedure.

      If the former check the environment settings on your console (needs to be Japanese not English) if the latter something is definitely wrong....
      Last edited by eek; 1 December 2016, 08:09.
      merely at clientco for the entertainment

      Comment


        #4
        Originally posted by eek View Post
        The default mode is Both so I don't Trailing helps.

        More serious answer are you running this from a console or from a stored procedure.

        If the former check the environment settings on your console (needs to be Japanese not English) if the latter something is definitely wrong....
        Not if you are using rtrim it isn't

        The other possible thing is he could have unknown characters in there, also.
        I had this once and only realised they were there after I had looked at the data in a hexadecimal editor.
        The Chunt of Chunts.

        Comment


          #5
          Originally posted by MrMarkyMark View Post
          Not if you are using rtrim it isn't

          The other possible thing is he could have unknown characters in there, also.
          I had this once and only realised they were there after I had looked at the data in a hexadecimal editor.
          True but there are very strange interactions between consoles and servers if the environment settings differ between them.

          The other approach is to wrap up your console sql script into a stored procedure, execute it and then delete the stored procedure.
          merely at clientco for the entertainment

          Comment


            #6
            Originally posted by eek View Post
            True but there are very strange interactions between consoles and servers if the environment settings differ between them.

            The other approach is to wrap up your console sql script into a stored procedure, execute it and then delete the stored procedure.

            Totally agree Bud.

            Sorry, I should have added I thought your suggestion was a very good one.
            The Chunt of Chunts.

            Comment


              #7
              I'm running it on Oracle SQL Developer, and I am not a (database) genius.
              …Maybe we ain’t that young anymore

              Comment


                #8
                It looks like this:


                ド                                                  ||


                Code:
                ド                                                 ||

                (I've added a || at the end to make it easier to see)
                …Maybe we ain’t that young anymore

                Comment


                  #9
                  That doesn't really help - you need the unicode/ hexadecimal view from say notepad++.

                  If you want a definitive its dodgy characters rather than console answer after that create stored procedures trim and select again....

                  Otherwise its environment interaction issues and I wish you luck for even oracle won't have a scooby's on how to fix it.
                  merely at clientco for the entertainment

                  Comment


                    #10
                    Are they definitely spaces?
                    If not, then you need to use either a substring or replace function.
                    I think from memory: REPLACE or SUBSTR.
                    Don't believe it, until you see it!

                    Comment

                    Working...
                    X