4 Replies Latest reply: Nov 20, 2012 1:07 AM by 971895 RSS

    Handling the quotes from a file in oracle

    924529
      Hi All,

      I'm getting a file which is having single quotes in one of the column for some of the records. I know we can handle single quotes by using either q or '' for the single quote characters. But I don't know which field is having the single quote or not, because I read these values from a file. Could any one please help is there any mechanism to handle this?

      Please advice.

      Regards,
      VG.
        • 1. Re: Handling the quotes from a file in oracle
          sb92075
          921526 wrote:
          Hi All,

          I'm getting a file which is having single quotes in one of the column for some of the records. I know we can handle single quotes by using either q or '' for the single quote characters. But I don't know which field is having the single quote or not, because I read these values from a file. Could any one please help is there any mechanism to handle this?

          Please advice.

          Regards,
          VG.
          blah, blah, blah

          Files do NOT have columns

          I don't know what you have.
          I don't know what you do.
          I don't know what you see.
          It is really, Really, REALLY difficult to fix a problem that can not be seen.
          use COPY & PASTE so we can see what you do & how Oracle responds.

          How do I ask a question on the forums?
          SQL and PL/SQL FAQ

          Handle:     921526
          Status Level:     Newbie
          Registered:     Mar 16, 2012
          Total Posts:     25
          Total Questions:     7 (5 unresolved)
          • 2. Re: Handling the quotes from a file in oracle
            rp0428
            >
            I'm getting a file which is having single quotes in one of the column for some of the records. I know we can handle single quotes by using either q or '' for the single quote characters. But I don't know which field is having the single quote or not, because I read these values from a file. Could any one please help is there any mechanism to handle this?
            >
            Handle what? You haven't mentioned anything that indicates a problem of any sort.

            Single quotes are only an issue when you are writing queries or code and include literal values. Your data is in a file so just insert it into the table using an external table definition, sql*loader, sql developer or some other tool.
            • 3. Re: Handling the quotes from a file in oracle
              jeneesh
              921526 wrote:
              Hi All,

              I'm getting a file which is having single quotes in one of the column for some of the records. I know we can handle single quotes by using either q or '' for the single quote characters. But I don't know which field is having the single quote or not, because I read these values from a file. Could any one please help is there any mechanism to handle this?
              You dont need to handle anything.

              Just read the file contents into VARCHAR2 variables and ORACLE will handle the rest..
              • 4. Re: Handling the quotes from a file in oracle
                971895
                there is no mechanism to handle single quotes in the file. try to load the data into table. column should have varchar2 data type..
                Let me know if you are facing any issue on this one.