1 2 Previous Next 18 Replies Latest reply: Oct 15, 2012 2:02 PM by user9026725 Go to original post RSS
      • 15. Re: update select into query
        Sven W.
        user9026725 wrote:
        The last suggestion updated all fields with 0.
        Hm. That can happen if your strings contain blanks at the beginning. How about if you show us some samples of your data first? So that we can stop guessing.
        Is there another way to tell it you just want to drop the letter off the end?
        That should be even more simple.

        Either
        regexp_substr(yourColumn,'\d')
        this simply takes all digits from the string.

        or
        regexp_replace(yourColumn,'\D$')
        this removes the last character if it is not a digit.

        Also always test it by looking at the selected data first. Do not update directly. (or at least be able to roll back afterwards).
        Edited by: Sven W. on Oct 11, 2012 8:39 PM
        • 16. Re: update select into query
          user9026725
          ok, here is my sample data:

          1289673004A
          1363349753A
          1269953566C
          1266668787A

          I need to fill table b with this data from table A and leave off the letter on the end. I tried the last suggestion and it inserted all ones in my field. I am running on a test database and do have rollback so my testing isn't causing a problem.

          Thanks for all the help I really appreciate it.
          • 17. Re: update select into query
            user9026725
            I found my duplicate data. I found out there are some duplicates that .adm on the end of them. I would like to run my update select query that I have but exclude the records with .adm on the end. This is what the data looks like:

            1267075316.ADM
            126707316E
            1267124112E

            what I need to update my table b with is just 1267124112

            Thanks for any help
            • 18. Re: update select into query
              user9026725
              Ok, I solved my own problem. I add the rownum = 1 back on it and it worked.

              Thank you for all the help.
              1 2 Previous Next