Writing Data to a file using TEXT_IO in Forms

I have a situtation where i have 5 columns and having arabic as well as english data. when i want to write this data to a txt file using TEXT_IO in a specific format, it writes to a file but as soon as it finds an arabic field, it changes the posistion. how can i write to a txt file in the posistion i want???

vaishnavinatarajan wrote:
How to write data to a file without leaving any blank lines in the file? How to check if the cursor is placed in the corner of a notepad file using LAB VIEW?
If you write data to a file, simply don't include any blank lines. We cannot give more specific advice unless you are telling us how you are writing. Are you writing to a new file or appending to an existing file. If the blank lines already exist, you need to read the entire file, remove the undesired lines from the string, and write the data back.
Notepad files don't have any "corners". Please describe what you are trying to do.
What is "LAB VIEW"?
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Problem while writing data on xls file using jxl API

    Hi,
    I am getting problem while writing data on excel file using jxl api.
    When i write data on file and all handles associated to the file are closed, file size increases but when i open the file nothing is written in it and when file is closed manually from excel window, file size decreased to its original that was before writing data.
    here is code:
              FileOutputStream os = new FileOutputStream(this.dirPath + this.fileName, true);
              WritableWorkbook this.workbook = Workbook.createWorkbook(os);
    after writing data following handler are closed:
    this.os.flush();
                        this.workbook.write();
                        this.workbook.close();
                        this.os.close();
                        this.os = null;
    can any body help me.
    Thanks in advance

    Err, I did help you. I did understand your problem; and I solved it for you. What was missing was that you apparently made no effort to understand what you were being told. Or even consider it. You just argued about it, as though you were the one with the solution, instead of the one whose code didn't work.
    And the other thing that was missing was the part where you said 'thank you' to me for solving your problem. Somewhat more appropriate than biting the hand that fed you, frankly. I do this for nothing, on my own gas, and it's extremely irritating when people keep asking about problems I have already solved for them. I am entitled to discourage that. It's part of making them more efficient actually.
    But it happens often enough that it also makes me think I'm just wasting my time. Probably I am.

  • Writing to a .dbf file using text_io

    Hi all,
    I'm trying to extract data from an Oracle form to a .dbf file. I would think that I can use text_io for this. If I have an existing .dbf file already (header and table information; everything except the data), can I just open the file with the append option (out_file := Text_IO.Fopen(dbase_file, 'a') and then just write the records?
    I tried writing a record to this file and then closing the file but I don't get any data. An example would be great as I'm not sure I need tab, end of line characters, etc.
    thanks.

    DBF is a binary file format -- it cannot be written using ordinary text I/O.
    Eric Adamson
    Lansing, Michigan

  • Reading data from flat file Using TEXT_IO

    Dear Gurus
    I already posted this question but this time i need some other changes .....Sorry for that ..
    I am using 10G forms and using TEXT_IO for reading data from flat file ..
    My data is like this :-
    0|BP-V1|20100928|01|1|2430962.89|27|2430962.89|MUR|20100928120106
    9|2430962.89|000111111111|
    1|61304.88|000014104113|
    1|41961.73|000022096086|
    1|38475.65|000023640081|
    1|49749.34|000032133154|
    1|35572.46|000033093377|
    1|246671.01|000042148111|
    Here each column is separated by | . I want to read all the columns and want to do some validation .
    How can i do ?
    Initially my requirement was to read only 2 or 3 columns so i did like this ...
    Procedure Pay_Simulator(lfile_type varchar2,lac_no varchar2,lcur varchar2,lno_item number,ltotal number,ldate date,lpay_purp varchar2,lfile_name varchar2)
    IS
    v_handle utl_file.file_type;
    v_filebuffer varchar2(500);
    line_0_date VARCHAR2 (10);
    line_0_Purp VARCHAR2 (10);
    line_0_count Number;
    line_0_sum number(12,2);
    line_0_ccy Varchar2(3);
    line_9_sum Number(12,2);
    line_9_Acc_no Varchar2(12);
    Line_1_Sum Number(12,2);
    Line_1_tot Number(15,2) := 0;
    Line_1_flag Number := 0;
    lval number;
    lacno varchar2(16);
    v_file varchar2(20);
    v_path varchar2(50);
    Begin
    v_file := mcb_simulator_pkg.GET_FILENAME(lfile_name); -- For the file name
    v_path :=rtrim(regexp_substr( lfile_name , '.*\\' ),'\'); For the Path
    v_path := SUBSTR (lfile_name,0, INSTR (lfile_name, '\', -1));
    v_handle := UTL_FILE.fopen (v_path, v_file, 'r');
    LOOP
    UTL_FILE.get_line (v_handle, v_filebuffer);
    IF SUBSTR (v_filebuffer, 0, 1) = '0' THEN
    SELECT line_0 INTO line_0_date
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 3;
    SELECT line_0 INTO line_0_Purp
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 4;
    SELECT line_0 INTO line_0_count
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 7;
    SELECT line_0 INTO line_0_sum
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 8;
    SELECT line_0 INTO line_0_ccy
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 9;
    ELSIF SUBSTR (v_filebuffer, 0, 1) = '9' THEN
    SELECT line_9 INTO line_9_Acc_no
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_9, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 3;
    SELECT line_9 INTO line_9_sum
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_9, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 2;
    ELSIF SUBSTR (v_filebuffer, 0, 1) = '1' THEN
    line_1_flag := line_1_flag+1;
    SELECT line_1 INTO line_1_sum
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_1, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 3;
    Line_1_tot := Line_1_tot + line_1_sum;
    END IF;
    END LOOP;
    DBMS_OUTPUT.put_line (Line_1_tot);
    DBMS_OUTPUT.PUT_LINE (Line_1_flag);
    UTL_FILE.fclose (v_handle);
    END;
    But now how can i do ? Shall i use like this select Statement for all the columns ?

    Sorry for that ..
    As per our requirement ...
    I need to read the flat file and it looks like like this .
    *0|BP-V1|20100928|01|1|2430962.89|9|2430962.89|MUR|20100928120106*
    *9|2430962.89|000111111111|*
    *1|61304.88|000014104113|*
    *1|41961.73|000022096086|*
    *1|38475.65|000023640081|*
    *1|49749.34|000032133154|*
    *1|35572.46|000033093377|*
    *1|246671.01|000042148111|*
    *1|120737.25|000053101979|*
    *1|151898.79|000082139768|*
    *1|84182.34|000082485593|*
    I have to check the file :-
    Validation are 1st line should start from 0 else it should raise an error and insert that error into one table .
    The for 2nd line also same thing ..it should start from 9 else it should raise an error and insert that error into one table .
    Then the 3rd line should start from 1 else it should raise an error and insert that error into one table .
    After that i have to do a validation like i will read the 1st line 2nd column .. It should be like this BP-V1 else raise an error and insert that error to a table . Then i will check the 3rd column which is 20100928 , it should be YYYYMMDD format else same thing ERROR.
    Then like this for all columns i have different validation .......
    Then it will check for the 2nd line 3rd column . this is an account no .1st i will check it should be 12 char else ERROR .Then I will check that what user has imputed in the form.Like for example User putted 111111111 then i will check with this 000111111111 which is there in the 2nd line . I have to add 000 before that Account no which user imputed .
    Then the lines which is starting from 1 , i have to take all the 2nd column for all the lines which is starting from 1 and i have to do a sum . After that i have to compare that sum with the value in the 1st lines ( Starting from 0) 6th column . It should be same else ERROR ...
    Then same way i have to count all the lines which is starting from 1 . Then i have to compare with the 7th column of 1st line . It should be same . Here in this file it should be 9.
    MY CODE IS :-
    Procedure Pay_Simulator(lfile_type varchar2,lac_no varchar2,lcur varchar2,lno_item number,ltotal number,ldate date,lpay_purp varchar2,lfile_name varchar2)
    IS
    v_handle TEXT_IO.file_type;
    v_filebuffer varchar2(500);
    line_0_date VARCHAR2 (10);
    line_0_Purp VARCHAR2 (10);
    line_0_count Number;
    line_0_sum number(12,2);
    line_0_ccy Varchar2(3);
    line_9_sum Number(12,2);
    line_9_Acc_no Varchar2(12);
    Line_1_Sum Number(12,2);
    Line_1_tot Number(15,2) := 0;
    Line_1_flag Number := 0;
    lval number;
    lacno varchar2(16);
    v_file varchar2(20);
    v_path varchar2(50);
    LC$String VARCHAR2(50) ;--:= 'one|two|three|four|five|six|seven' ;
    LC$Token VARCHAR2(100) ;
    i PLS_INTEGER := 2 ;
    lfirst_char number;
    lvalue Varchar2(100) ;
    Begin
    v_file := mcb_simulator_pkg.GET_FILENAME(lfile_name); For the file name
    v_path :=rtrim(regexp_substr( lfile_name , '.*\\' ),'\'); For the Path
    --v_path := SUBSTR (lfile_name,0, INSTR (lfile_name, '\', -1));
    Message(lfile_name);
    v_handle := TEXT_IO.fopen(lfile_name, 'r');
              BEGIN
                        LOOP
                        TEXT_IO.get_line (v_handle, v_filebuffer);
                        lfirst_char := Substr(v_filebuffer,0,1);
                        --Message('First Char '||lfirst_char); 
                                  IF lfirst_char = '0' Then
                                  Loop
                                  LC$Token := mcb_simulator_pkg.Split( v_filebuffer, i , '|') ;
                                  Message('VAL - '||LC$Token);
                                  lvalue := LC$Token;
                                  EXIT WHEN LC$Token IS NULL ;
    i := i + 1 ;
    End Loop;
                                  Else
                                       Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (9999,'0002','First line should always start with 0');
                                       Forms_DDL('Commit');
                                       raise form_Trigger_failure;
                                  End if ;
                        TEXT_IO.get_line (v_handle, v_filebuffer);
                        lfirst_char := Substr(v_filebuffer,0,1);
                        LC$Token := mcb_simulator_pkg.Split( v_filebuffer, i , '|') ;
                        --Message('Row '||LC$Token);
                             IF lfirst_char = '9' Then
                                  Null;
                             Else
                                  Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (8888,'0016','Second line should start with 9');
                                  Forms_DDL('Commit');
                                  raise form_Trigger_failure;
                             End IF;
                        LOOP
                        TEXT_IO.get_line (v_handle, v_filebuffer);
                        lfirst_char := Substr(v_filebuffer,0,1);
                        LC$Token := mcb_simulator_pkg.Split( v_filebuffer, i , '|') ;
                        --Message('Row '||LC$Token);
                                  IF lfirst_char = '1' Then
                                  Null;
                                  Else
                                       Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (7777,'0022','The third line onward should start with 1');
                                       Forms_DDL('Commit');
                                       raise form_Trigger_failure;
                                  End if;
                        END LOOP;
                        --END IF;
                        END LOOP;
              EXCEPTION
                   When No_Data_Found Then
              TEXT_IO.fclose (v_handle);
              END;
    Exception
         When Others Then
         Message('Other error');
    END;
    I am calling the FUNCTION which you gave SPLIT as mcb_simulator_pkg.Split.

  • Appending XML data to a file using file adaptor

    Hi,
    I am trying to append data to a file using file adaptor in XML format. (Objective is to store data as XML message in the file). I understand it is possible to append data to an existing file by making appropriate changes in WSDL manually. However, my issue is every time the XML data is appended to a file even the XML header message is also getting appended. As a result the file data does not adhere to defined schema structure anymore.
    Is there a way to save XML data in a file in append mode ?
    Thanks, Riz

    I am having the same issue as well, which makes the output XML an invalid one. I have an XSD that has a hierarchy of elements. whenever I am wiriting the child elements the header message & the name space is also getting written. For example
    <?xml version="1.0" ?><Parent xmlns="http://testSchema.com/outputSchema">
    <StartDate>01/01/2001</StartDate>
    <EndDate>01/30/2001</EndDate>
    <Child/>
    </Parent>
    <?xml version="1.0" ?><Child xmlns:ns1="http://testSchema.com/outputSchema">
    <ns1:Id>20012981</ns1:Id>
    <ns1:Value/>
    <ns1:Date>01/15/2001</ns1:Date>
    </Child>
    <?xml version="1.0" ?><Child xmlns:ns1="http://testSchema.com/outputSchema">
    <ns1:Id>20012981</ns1:Id>
    <ns1:Value/>
    <ns1:Date>01/15/2001</ns1:Date>
    </Child>
    I am using a onefile adapter partnerlink to write the parent & an another one for writing the child element, since the child elements will repeat more than once. One other way to fix this issue is write the data using java embedded activity, but that would need a lot of boiler plate code, for writing/reading/appending the same file & for handling all those IOexceptions & buffer IN/outs. I am curious if someone had the same issue & how they resolved it.

  • Writing data to a file in Server

    Hi all,
    In my application i would be writing data to a file which is located in the Server.
    when i tried writing data to a file in my local machine using a Java Application it worked fine .
    Now through the webdynpro application and providing the files path (in server ) ,i am getting file not found exception .
    I am using basic File and i/o operations .
    File abc = new File ("
    servernamer
    folder1
    subfolder1
    filename.dat");
    when i try accessing this path from the command prompt its opening fine.
    Could you please through some light on this .
    thanks,
    swetha .

    >
    KalluriVijay wrote:
    > Hi Swetha,
    > Do one think.
    > InputStream text = null;
    >                int temp = 0;
    >                //File file = new File(wdContext.currentContextElement().getResource().getResourceName().toString());
    >                //wdComponentAPI.getMessageManager().reportSuccess("filePath Vijay:::"+file);     
    > //wdComponentAPI.getMessageManager().reportSuccess("filePath Vijay:::");
    >                     try
    >                     {
    >                     String fileName = wdContext.currentContextElement().getResource().getResourceName().toString();               
    >                     if(fileName.equalsIgnoreCase("ASNCRT.dat"))
    >                     {     
    >                     File file = new File(fileName);                         
    >                     FileOutputStream op = new FileOutputStream(file);          
    >                     if (wdContext.currentContextElement().getResource()!= null)
    >                     {
    >                     text = wdContext.currentContextElement().getResource().read(false);
    >                     while((temp=text.read())!= -1)
    >                     {
    >                     op.write(temp);
    >                     }
    >                     }
    >                     op.flush();
    >                     op.close();
    >                     path = file.getAbsolutePath();
    >                     //wdComponentAPI.getMessageManager().reportSuccess(path);
    >                     }
    >                     else
    >                     {
    >                     wdComponentAPI.getMessageManager().raiseException("Please Check the Filename:Filename should be ASNCRT.dat ",true);     
    >                     }
    >                     }
    >                     catch(Exception ex)               
    >                     {
    >                     ex.printStackTrace();
    >                     }
    > By using this code u can put u r file in to Server Path, then u will get the that .dat file from server path and run the command prompt its opening fine
    > How to get the file from the Server Path:
    > Workbook wb = Workbook.getWorkbook(new File(path));     // For get the file from the Server path
    >
    >   Hope this is help full for u
    > Regards
    > Vijay Kalluri
    This won't work. First, like i said, File class is not for accessing remote files, it is only for local files.
    Second, Workbook class is a class from Java Excel API. He is not working with xls. Anyway that wouldn't work either.

  • Not able to extract performance data from .ETL file using xperf commands. getting error "Events were lost in this trace. Data may be unreliable ..."

    Not able to extract  performance data from .ETL file using xperf commands.
    Xperf Commands:
    xperf –i C:\TempFolder\Test.etl -o C:\TempFolder\BootData.csv  –a process
    Getting following error after executing above command:
    "33288636 Events were lost
    in this trace. 
    Data may be unreliable
    This is usually caused
    by insufficient disk bandwidth for ETW lo
    gging.
    Please try increasing the minimum
    and maximum number of buffers
    and/or
                    the buffer size. 
    Doubling these values would be a good first at
    tempt.
    Please note, though, that
    this action increases the amount of me
    mory
                    reserved
    for ETW buffers, increasing memory pressure on your sce
    nario.
    See "xperf -help start"
    for the associated command line options."
    I changed page size file but its does not work for me.
    Any one have idea, how to solve this problem and extract ETL file data.

    I want to mention one point here. I have total 4 machines out of these 3 machines above
    commands working properly. Only one machine has this problem.<o:p></o:p>
    Hi,
    I consider that you can try to use xperf to collect the trace etl file and see if it can be extracted on this computer:
    Refer to following articles:
    start
    http://msdn.microsoft.com/en-us/library/windows/hardware/hh162977.aspx
    Using Xperf to take a Trace (updated)
    http://blogs.msdn.com/b/pigscanfly/archive/2008/02/16/using-xperf-to-take-a-trace.aspx
    Kate Li
    TechNet Community Support

  • Display data in log file using PL/SQL procedure

    Just as srw.message is used in Oracle RDF Reports to display data in log file in Oracle Apps, similarly how it is possible to display data in log file using PL/SQL procedure?
    Please also mention the syntax too.

    Pl post details of OS, database and EBS versions.
    You will need to invoke the seeded FND_LOG procedure - see previous discussions on this topic
    Enable debug for pl/sql
    https://forums.oracle.com/forums/search.jspa?threadID=&q=FND_LOG&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    HTH
    Srini

  • Creating data and .par files using SWIFT Integration Package

    Hi,
    I have a requirement to generate a data and .par file using SAP PI Integration package for SWIFT.
    I am following the SAP Note: 1303428.
    I have created 1 sender and 2 receiver comm channels(one for payload and other for par). Used operation mapping SWIFT_payload_parFile_split in the Interface determination.
    I am using the adapter module : localejbs/swift/FileActConversionToSWIFTModule and setting the parameter DetachParameters to true. This adapter module is being used in all the three channels(1 sender and 2 receivers).
    I have used ASMA ans has set the FileName checkbox.
    Now after placing the file in the input directory, the file with the same name gets created in the output directory but the file is exactly same and also no .par file is getting created. I have set the Empty file handling to Ignore, so it shows that there is no data to  create a .par file and only payload file is getting created but the payload file is exactly same.
    Also if I use the adapter module : localejbs/swift/FileActConversionToSWIFTModule in only the sender communication channel, a payload file gets created like below.
    <?xml version="1.0" encoding="UTF-8"?>
    -<ns1:SWIFT_payload xmlns:ns1="http://sap.com/xi/SWIFT"><payload>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPEZpbGU+CiA8UGFyYW1ldGVycyB4bWxucz0idXJuOnN3aWZ0OnNhZzp4c2Q6ZnRhLnBhcmFtLjEuMCIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSI+CiAgPE92ZXJyaWRlcz4KICAgPFJlc3BvbmRlcj5jbj1jZngsb3U9bmEsbz1jaXRpZ2IybCxvPXN3aWZ0PC9SZXNwb25kZXI+CiAgIDxTZXJ2aWNlPnN3aWZ0LmNvcnAuZmEhcDwvU2VydmljZT4KICAgPFJlcXVlc3RUeXBlPnBhaW4uMDAxLjAwMS4wMzwvUmVxdWVzdFR5cGU+CiAgIDxUcmFuc2ZlckRlc2NyaXB0aW9uPkIwNDExMC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10SW5mPgogICAgPC9DZHRUcmZUeEluZj4KICAgPC9QbXRJbmY+CiAgPC9Dc3RtckNkdFRyZkluaXRuPgogPC9Eb2N1bWVudD4KPC9GaWxlPgo=</payload></ns1:SWIFT_payload>
    But while creating the par file, it shows that the file could not be overwritten and so the .par file is not getting created.
    I need to understand that:
    1)  How do I configure both of my receiver channels i.e. what should be the difference. Currently, I am just setting the
    same Output directory in both and file name schema * and has used ASMA with FileName parameter. So same name files are getting created and so one file gets discarded. How to create a .par file.
    2) Also Is the file above is the correct file required by SWIFT.
    3) Also when I check in SXMB_MONI, I can see that after running the adapter module same payload as given above is going in both payload and par files i.e. also if I am using different names in my receiver communication channels two files are getting created payload and par both are having the same payload. So what exactly should get created.
    Kindly guide on this implementation.

    Hi,
    I am able to generate the .par file by setting the localsecurity to true and the KeyId from the key manager.
    Now two files are getting created .xml and .par. .xml file which is the payload file is the same as the input file with no difference and contains both the overrides and the data parameters. The .par file contains the Algorithm and the Value.
    Is this correct?
    Also suppose the input file name is SEPA.xml, then the payload file is created with the name as
    SEPA.xml and the par file is created with the name SEPA.xml.par. I need only SEPA.par. How to achieve this.

  • How to write data to text file using external tables

    can anybody tell how to write data to text file using external tables concept?

    Hi,
    Using external table u can load the data in your local table in database,
    then using your local db table and UTL_FILE pacakge u can wrrite data to text file
    external table
    ~~~~~~~~~~~
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7002.htm#i2153251
    UTL_FILE
    ~~~~~~~~~
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#sthref14093
    Message was edited by:
    Nicloei W
    Message was edited by:
    Nicloei W

  • How to Write data in Excel File using java

    Hi
    can anybody help me to write data in excel file
    using java code
    Thankx In Advance

    How much are you willing to pay for that?
    If you want it for free, http://jexcelapi.sourceforge.net/

  • Spool SQl data into text file using dynamic sql

    Hi,
    I am spooling output data into text file using command
    select 'select t.mxname,bo.lxtype,t.mxrev'||chr(10)||'from mx_1234567'||chr(10)||
    'where <condition>';
    here mxname varchar(128),lxtype(128),mxrev(128) all are of varchar type.I want the output in format
    e.g Part|1211121313|A
    but due to column width the output,I am getting is with spaces.
    "Part then blank spaces |1211121313 then blank spaces |A"
    how can I remove these spaces between columns.I used set space 0 but not working.
    Thanks in advance.
    Your help will be appreciated.

    Hi Frank,
    I have seen your reply for SET LINE SIZE function. But, I could not be able to understand it.
    I am facing similar kind of issue in my present project.
    I am trying spool more than 50 columns from a table into flat file. Because of more column lengths in few columns, i am getting space. There are so many columns with the same issue. I want to remove that space.so that, data can fit perfectly in one line in .txt file without any wrap text.
    Below is my sample query.sql. Please let me know the syntax. My mail id : [email protected]
    --Created : Sep 22,2008, Created By : Srinivasa Bojja
    --Export all Fulfillments
    --Scheduled daily after 1:00am and should complete before 3:30am
    WHENEVER SQLERROR EXIT SQL.SQLCODE
    SET LINESIZE 800
    SET WRAP OFF
    SET PAGESIZE 800
    SET FEEDBACK OFF
    SET HEADING ON
    SET ECHO OFF
    SET CONCAT OFF
    SET COLSEP '|'
    SET UNDERLINE OFF
    SPOOL C:\Fulfillment.txt;
    SELECT SRV.COMM_METHOD_CD AS Method,
    SRV.SR_NUM AS "Fulfillment Row_Id",
    CON.LAST_NAME AS "Filled By"
    SRV.SR_TITLE AS Notes,
    SRVXM.ATTRIB_04 AS "Form Description"
    FROM SIEBEL.S_SRV_REQ SRV,
    SIEBEL.S_SRV_REQ_XM SRVXM,
    SIEBEL.S_USER USR,
    SIEBEL.S_CONTACT CON
    WHERE SRV.ROW_ID = SRVXM.PAR_ROW_ID AND
    SRV.OWNER_EMP_ID = USR.ROW_ID AND
    CON.ROW_ID= SRV.CST_CON_ID;
    SPOOL OFF;
    EXIT;

  • How to write non-XML data to a file using an OSB FTP Routing?

    Hi --
    Situation ... I need to write non-XML data to a file using FTP. A proxy service retrieves XML and transforms it with XSLT to CSV format, then gives it to a Biz service to file it out, using FTP. Simple.
    Problem ... OSB sends the contents of $body to any service it calls. Because $body is a SOAP document, it has to contain XML. So therefore I have to put my CSV data into an XML element, in order to put it into $body; and this inner element then gets written to the file, which I don’t want. But if I don't enclose my CSV content in a tag, I get "Unexpected CDATA encountered" trying to assign it to a variable.
    There has to be away around this!
    Thanks for your help.
    John Taylor

    Solved. Steps:
    -- Transform the XML to CSV using an XSL transform. Put the CSV data inside enclosing XML elements, and use a Replace action to put the XML element + CSV contents back into *$body*.
    -- Define an MFL transform that only knows about the enclosing XML elements. Use a delimiter of "\n" (hard return).
    -- Route from the proxy service to a Biz service that has Service Type = Messaging Service and Request Message Type = MFL; specify the MFL transform, which will receive the incoming *$body* variable, strip off the enclosing XML element within it, and pass the CSV contents to the FTP service.
    Edited by: DunedainRanger on Nov 29, 2011 9:03 AM

  • Export batch data into CSV file using SQL SP

    Hi,
    I have created WCF-Custom receive adapter to poll Sql SP (WITH xmlnamespaces(DEFAULT 'Namespace' and For XML PATH(''), Type) . Get the result properly in batch while polling and but getting error while converting into CSV by using map.
    Please can anyone give me some idea to export SQL data into CSV file using SP.

    How are you doing this.
    You would have got XML representation for the XML batch received from SQL
    You should have a flat-file schema representing the CSV file which you want to send.
    Map the received XML representation of data from SQL to flat-file schema
    have custom pipeline with flat-file assembler on the assembler stage of the send pipeline.
    In the send port use the map which convert received XML from SQL to flat file schema and use the above custom flat-file disassembler send port
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Writing to a flat file using UTL in a procedure

    Hello All,
    I am creating a procedure in which I am trying to write data to a flat file using UTL. Code is shown below:
    CREATE OR REPLACE PROCEDURE wrt_lifungduty IS
       sql_stmt             varchar2(200);
       sql_stmt1            varchar2(200);
       sql_stmt2            varchar2(200);
       v_cur_hdl            integer;
       v_rows_processed     BINARY_INTEGER;
       V_file           UTL_FILE.FILE_TYPE;
       V_flatfile_line      VARCHAR2(98) := NULL;
      V_OBLIGATION_KEY    NUMBER(10);
      V_OBLIGATION_LEVEL  VARCHAR2(6);
      V_KEY_VALUE_1       VARCHAR2(20);
      V_KEY_VALUE_2       VARCHAR2(20);
      V_PARTNER_TYPE      VARCHAR2(6);
      V_PARTNER_ID        VARCHAR2(10);
      V_EXT_INVC_NO       VARCHAR2(30);
      V_EXT_INVC_DATE     DATE;
      V_PAID_DATE         DATE;
      V_PAID_AMT          NUMBER(20,4);
      V_COMP_ID           VARCHAR2(10);
      V_RECEIPT_DATE      DATE;
      V_ORDER_QTY         NUMBER(12,4);
      V_RECEIPT_QTY       NUMBER(12,4);
      V_FRT               NUMBER;
      V_DUTY              NUMBER;
      V_SUPPLIER          NUMBER;
      V_FLAG              VARCHAR2(1);
      V_ELC_COST          NUMBER;
      V_ADJ_ELC           NUMBER;
    Cursor x is
          select OBLIGATION_KEY,OBLIGATION_LEVEL,KEY_VALUE_1,KEY_VALUE_2,PARTNER_TYPE,PARTNER_ID,EXT_INVC_NO,EXT_INVC_DATE
                 ,PAID_DATE,PAID_AMT,COMP_ID,RECEIPT_DATE,ORDER_QTY,RECEIPT_QTY,FRT,DUTY,SUPPLIER,FLAG,ELC_COST,ADJ_ELC
          from RMSBIZ.CT_ANALYZE_LIFUNG_DUTY;    
    BEGIN
    if not UTL_FILE.IS_OPEN(V_file) then
          V_file := UTL_FILE.FOPEN('/exchange/biz/rms2lan','sb_duty.dat','w'); --need to give the location for testing
       end if;
    for x1 in x loop
      V_OBLIGATION_KEY    :=1;
      V_OBLIGATION_LEVEL  :='test';
      V_OBLIGATION_KEY    :=x1.OBLIGATION_KEY;
      V_OBLIGATION_LEVEL  :=x1.OBLIGATION_LEVEL;
      V_KEY_VALUE_1       :=x1.KEY_VALUE_1;
      V_KEY_VALUE_2       :=x1.KEY_VALUE_2;
      V_PARTNER_TYPE      :=x1.PARTNER_TYPE;
      V_PARTNER_ID        :=x1.PARTNER_ID;
      V_EXT_INVC_NO       :=x1.EXT_INVC_NO;
      V_EXT_INVC_DATE     :=x1.EXT_INVC_DATE;
      V_PAID_DATE         :=x1.PAID_DATE;
      V_PAID_AMT          :=x1.PAID_AMT;
      V_COMP_ID           :=x1.COMP_ID;
      V_RECEIPT_DATE      :=x1.RECEIPT_DATE;
      V_ORDER_QTY         :=x1.ORDER_QTY;
      V_RECEIPT_QTY       :=x1.RECEIPT_QTY;
      V_FRT               :=x1.FRT;
      V_DUTY              :=x1.DUTY;
      V_SUPPLIER          :=x1.SUPPLIER;
      V_FLAG              :=x1.FLAG;
      V_ELC_COST          :=x1.ELC_COST;
      V_ADJ_ELC           :=x1.ADJ_ELC;
      V_flatfile_line:=  V_OBLIGATION_KEY||','||
      V_OBLIGATION_LEVEL  ||','||
      V_KEY_VALUE_1       ||','||
      V_KEY_VALUE_2       ||','||
      V_PARTNER_TYPE      ||','||
      V_PARTNER_ID        ||','||
      V_EXT_INVC_NO       ||','||
      V_EXT_INVC_DATE     ||','||
      V_PAID_DATE         ||','||
      V_PAID_AMT          ||','||
      V_COMP_ID           ||','||
      V_RECEIPT_DATE      ||','||
      V_ORDER_QTY         ||','||
      V_RECEIPT_QTY       ||','||
      V_FRT               ||','||
      V_DUTY              ||','||
      V_SUPPLIER          ||','||
      V_FLAG              ||','||
      V_ELC_COST          ||','||
      V_ADJ_ELC;
    V_flatfile_line:= V_OBLIGATION_KEY||','|| V_OBLIGATION_LEVEL;
        UTL_FILE.PUT_LINE(V_file, V_flatfile_line);
    end loop
      commit;
       UTL_FILE.fclose(V_file); 
    END;
                Getting the following errors:
    SQL>Welcome-->
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "SYS.UTL_FILE", line 98
    ORA-06512: at "SYS.UTL_FILE", line 157
    ORA-06512: at "RMSBIZ.WRT_LIFUNGDUTY", line 39
    ORA-06512: at line 1
    SQL>Welcome-->39
    39* V_file := UTL_FILE.FOPEN('/exchange/biz/rms2lan','sb_duty.dat','w');
    SQL>Welcome-->
    Does any one know why it is erroring out?
    Thanks,
    Chiru

    the code below works if i take out the last 3 columns while writing to the flat file line.
    CREATE OR REPLACE PROCEDURE wrt_lifungduty IS
       sql_stmt             varchar2(200);
       sql_stmt1            varchar2(200);
       sql_stmt2            varchar2(200);
       v_cur_hdl            integer;
       v_rows_processed     BINARY_INTEGER;
       V_file           UTL_FILE.FILE_TYPE;
       V_flatfile_line      VARCHAR2(98) := NULL;
      V_OBLIGATION_KEY    NUMBER(10);
      V_OBLIGATION_LEVEL  VARCHAR2(6);
      V_KEY_VALUE_1       VARCHAR2(20);
      V_KEY_VALUE_2       VARCHAR2(20);
      V_PARTNER_TYPE      VARCHAR2(6);
      V_PARTNER_ID        VARCHAR2(10);
      V_EXT_INVC_NO       VARCHAR2(30);
      V_EXT_INVC_DATE     DATE;
      V_PAID_DATE         DATE;
      V_PAID_AMT          NUMBER(20,4);
      V_COMP_ID           VARCHAR2(10);
      V_RECEIPT_DATE      DATE;
      V_ORDER_QTY         NUMBER(12,4);
      V_RECEIPT_QTY       NUMBER(12,4);
      V_FRT               NUMBER;
      V_DUTY              NUMBER;
      V_SUPPLIER          NUMBER;
      V_FLAG              VARCHAR2(1);
      V_ELC_COST          VARCHAR2(20);
      V_ADJ_ELC           VARCHAR2(20);
    Cursor x is
          select OBLIGATION_KEY,OBLIGATION_LEVEL,KEY_VALUE_1,KEY_VALUE_2,PARTNER_TYPE,PARTNER_ID,EXT_INVC_NO,EXT_INVC_DATE
                 ,PAID_DATE,PAID_AMT,COMP_ID,RECEIPT_DATE,ORDER_QTY,RECEIPT_QTY,FRT,DUTY,SUPPLIER,FLAG,ELC_COST,ADJ_ELC
          from RMSBIZ.CT_ANALYZE_LIFUNG_DUTY;
    BEGIN
    if not UTL_FILE.IS_OPEN(V_file) then
          V_file := UTL_FILE.FOPEN('/rmsapps/rms803/biz/data/utl_files','sb_duty.csv','w'); --need to give the location for testing
       end if;
    for x1 in x loop
      V_OBLIGATION_KEY    :=nvl(x1.OBLIGATION_KEY,null);
      V_OBLIGATION_LEVEL  :=nvl(x1.OBLIGATION_LEVEL,null);
      V_KEY_VALUE_1       :=x1.KEY_VALUE_1;
      V_KEY_VALUE_2       :=x1.KEY_VALUE_2;
      V_PARTNER_TYPE      :=x1.PARTNER_TYPE;
      V_PARTNER_ID        :=x1.PARTNER_ID;
      V_EXT_INVC_NO       :=x1.EXT_INVC_NO;
      V_EXT_INVC_DATE     :=x1.EXT_INVC_DATE;
      V_PAID_DATE         :=x1.PAID_DATE;
      V_PAID_AMT          :=x1.PAID_AMT;
      V_COMP_ID           :=x1.COMP_ID;
      V_RECEIPT_DATE      :=x1.RECEIPT_DATE;
      V_ORDER_QTY         :=x1.ORDER_QTY;
      V_RECEIPT_QTY       :=x1.RECEIPT_QTY;
      V_FRT               :=x1.FRT;
      V_DUTY              :=x1.DUTY;
      V_SUPPLIER          :=x1.SUPPLIER;
      V_FLAG              :=nvl(x1.FLAG,'0');
      V_ELC_COST          :=to_char(nvl(x1.ELC_COST,0));
      V_ADJ_ELC           :=to_char(nvl(x1.ADJ_ELC,0));
      V_flatfile_line:=  V_OBLIGATION_KEY||','||
      V_OBLIGATION_LEVEL  ||','||
      V_KEY_VALUE_1       ||','||
      V_KEY_VALUE_2       ||','||
      V_PARTNER_TYPE      ||','||
      V_PARTNER_ID        ||','||
      V_EXT_INVC_NO       ||','||
      V_EXT_INVC_DATE     ||','||
      V_PAID_DATE         ||','||
      V_PAID_AMT          ||','||
      V_COMP_ID           ||','||
      V_RECEIPT_DATE      ||','||
      V_ORDER_QTY         ||','||
      V_RECEIPT_QTY       ||','||
      V_FRT               ||','||
      V_DUTY              ||','||
      V_SUPPLIER          ||','||
    -- V_FLAG            ||','||
      V_ELC_COST          ||','||
      V_ADJ_ELC;
        UTL_FILE.PUT_LINE(V_file, V_flatfile_line);
    end loop
      commit;
       UTL_FILE.fclose(V_file);
    EXCEPTION
      WHEN UTL_FILE.INVALID_PATH
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: INVALID_PATH');
      WHEN UTL_FILE.INVALID_MODE
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: INVALID_MODE');
      WHEN UTL_FILE.INVALID_FILEHANDLE
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: INVALID_FILEHANDLE');
      WHEN UTL_FILE.INVALID_OPERATION
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: INVALID_OPERATION');
      WHEN UTL_FILE.READ_ERROR
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: READ_ERROR');
      WHEN UTL_FILE.WRITE_ERROR
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: WRITE_ERROR');
      WHEN UTL_FILE.INTERNAL_ERROR
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: INTERNAL_ERROR');
      WHEN OTHERS THEN
         --     v_error_code := SQLCODE;
    --          v_error_message := SQLERRM;
    --         dbms_output.put_line('ERROR: '||v_error_code);
       --       dbms_output.put_line('ERROR: '||v_error_message);
              RAISE_APPLICATION_ERROR(-20003,'sbduty - aborted');  
    END;
    /It fails as soon as it encounters the V_FLAG in the V_flat_file_line. The data in the table has nulls for the FLAG, and some -ve numbers for the ELC_COST,ADJ_ELC..but that should'nt cause any problems does it?
    Whats wrong with those 3 columns?
    Errors that i get are:
    SQL>Welcome-->BEGIN wrt_lifungduty; END;
    ERROR at line 1:
    ORA-20003: sbduty - aborted
    ORA-06512: at "RMSBIZ.WRT_LIFUNGDUTY", line 117
    ORA-06512: at line 1
    SQL>Welcome-->117
    117* RAISE_APPLICATION_ERROR(-20003,'sbduty - aborted');
    SQL>Welcome-->
    Thanks,
    Chiru

Maybe you are looking for