2 Replies Latest reply: Dec 11, 2012 9:26 AM by EmaxG RSS

    Format PLSQL output?

    EmaxG
      Hi,

      I have a SP that executes a query and writes the output to a OS file. If I execute this from toad or any tool there is a field VARCHAR2(500) which is readable and looks OK.
      However, when this is written into a file or the .txt generated imported into anything all the lines are broken

      Example:
      0|1;30/11/10|01/01/01;E;2|PRUEBA|R;98|0;PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA 
      PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA 
      PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA 
      ;832734;0;C;01/01/01|0|0;0;-;-;-;-|-|-|-|-;7|PRUEBA PRUEBA PRUEBA PRUEBA |7|0;1|PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA PRUEBA |1|3;0|-|-|-;0|-|-|-
      0|1;30/11/10|01/01/01;E;
      Importing the file into e.g. excel using ; as a separator will make this data to be present in 4-5 rows instead of one.
      How can I fix this? I have set a maximum lenght of line well above the top value when I do UTL_FILE.FOPEN so this is not the problem.

      Thank you in advance.
        • 1. Re: Format PLSQL output?
          JustinCave
          Can you post the UTL_FILE code you're using to open the file and write the data? Have you opened the file in a hex editor to confirm that the unexpected line breaks exist in the file before you run the import process and that these aren't artifacts of whatever import process you're running? Have you DUMP'd the data from the VARCHAR2(500) variable to confirm that there are no line breaks in the data?

          Justin
          • 2. Re: Format PLSQL output?
            EmaxG
            Thanks for your reply, the problem is with the data.
            I just exported to excel and it shows like that with the squares showing the break.

            Edited by: N K on Dec 11, 2012 7:25 AM