Write UTL_FILE - a record should be in line

Hello

I use UTL_FILE to create the file, using reocrds aren't in a single line of code. Please let me know
How to fix it.
 v_text_line :=     v_main.mem_num||'~'||
                    v_main.full_name||'~'||'~'||'~'||
                    v_main.start_date||'~'||
                    v_main.end_date||'~'||'~'||
                    v_main.trans_code||'~'||'~'||
                    v_main.trans_desc||'~'||
                         v_main.reason_code
                         ;
Here is the actual result
305591768C~RANDY MACHOMAN~~~20100318~20100318~~183507~~~FRI~TOURED VISTA
~-1
007080001B~SIRISHA SURAPA~~~20100318~20100318~~183526~~~FRI~VACATION PURCHASE
~-21
expected result
305591768C~RANDY MACHOMAN~~~20100318~20100318~~183507~~~FRI~TOURED VISTA~-1
007080001B~SIRISHA SURAPA~~~20100318~20100318~~183526~~~FRI~VACATION PURCHASE~-21
Thank you
Sandy

It worked but now it is written, same records 12 times. How fix it.earlier it was not creating the records twice.

It's strange. REPLACE it shouldn't have any impact.
You are (re) define your variables in a loop at the right place/time?

Tags: Database

Similar Questions

  • Save now don't read do not HP DVD Writer 1140r as recordable legacy

    Save message now says no compatible recordable legacy found on the system. Do you have all the troubleshooting & uninstalled, restarted, new message material found, always the same.  Legacy Bishop reading drive HP DVD Writer 1140r but Record now sees him only as a player, not registrable as it used to.

    Hello:

    I thought that maybe your model needed a storage controller driver so that the registration program could see the drive.  But your PC will not need this.

    Have you tried another DVD burning software program?

    I love this one. It's free and easy to use.

    Download the 32-bit version without Open candy (click on the blue, that more download link Options).

    http://CDBurnerXP.se/en/download

    Paul

  • Spry validation continues to write me a record of MySQL

    Hello

    It is very strange and has been driving me crazy for a few days now. With the help of DW CS6 / Win 7 / 11 IE / FF / Chrome.

    I had a request form that worked properly, validated the entry and wrote a new record to a MySQL database. I had to develop a very similar web page so I took the existing page and updated.

    I found, after much trial and error, I can write a new record containing valid data but spry does not work - no validation and no indications appear in the text boxes. Or I can get spry validation works but the web page crashes when I try and write a new record.

    Among other changes, the former page had a checkbox control that I deleted the new page, and there is no other boxes on the page. When I remove the js "var sprycheckbox2 = new Spry.Widget.ValidationCheckbox ("sprycheckbox2");" Spry validation work, tips appear etc, but the page crashes when I click on the button "Next step" that needs to write to the db. If I leave the js for the widget on the page I get no advice or spry validation but the record is written to the db. In both cases I had commented the link to 'SpryValidationCheckbox.js.

    Here is a link to the version that has the widget http://www.hollisterairshow.com/rally/vendorApp2.php?blapp=inline & tspapp = inline & tfpapp = ine inl , there is no evidence in the text boxes and spry validation happens at all, but he writes a record of the db. Here is a link to the version where I commented on the js for the checkbox widget - this is the second in the list of widgets at the end of the page. I made no other changes http://www.hollisterairshow.com/rally/vendorApp3.php?blapp=inline & tspapp = inline & tfpapp = ine inl

    It seems that the widgets have been added at the end of the google analytic code but I don't know if this is relevant.

    I also get widgets missing when I open the page in DW, the box I mentioned is the first below, this might be relevant? Just remove the js for each of the widgets listed?  Sorry if this is a basic question, I get very confused at this point.

    spry.png

    I'd appreciate really certain direction to try to solve this problem.

    Thank you

    Tony

    Thank you so much Nancy, which works very well and the example has been most helpful. So far, I've removed all references to spry validation and added about 20 areas, only 10 or more to go, and at least I can validate and write records to the db.

    Thanks again,

    Tony Babb.

  • UTL_FILE error record

    Hi gurus

    I use this Procedure to generate the csv file of linux DB server and save it to the windows file system.

    Select * from dba_directories;

    SYS CREDIT_REPORTS /cifs/mnt/credit_report

    I checked that Samba is running.

    [root@abcoracle ~] # ps - ef | grep smbd

    32295 root 32096 0 22:01 pts/2 00:00:00 grep smbd

    My proc

    create or replace

    Run_query P_sql() PROCEDURE in VARCHAR2

    ,, p_dir IN VARCHAR2

    ,, p_header_file IN VARCHAR2

    ,, p_data_file IN VARCHAR2 := NULL) IS

    v_finaltxt(VARCHAR2) 4000);

    v_v_val(VARCHAR2) 4000);

    v_n_val NUMBER;

    v_d_val DATE;

    v_ret NUMBER;

    c NUMBER;

    d NUMBER;

    col_cnt INTEGER.

    f BOOLEAN;

    rec_tab DBMS_SQL. DESC_TAB;

    col_num NUMBER;

    UTL_FILE. v_fh TYPE_DE_FICHIER;

    BOOLEAN := v_samefile (NVL ()p_data_file p_header_file) = p_header_file);

    BEGIN

    c := DBMS_SQL. OPEN_CURSOR;

    DBMS_SQL. ANALYSIS() c, p_sql,. DBMS_SQL NATIVE);

    d := DBMS_SQL. RUN() c);

    DBMS_SQL. DESCRIBE_COLUMNS() c, col_cnt, rec_tab);

    FOR j 1. . col_cnt

    LOOP

    CASE rec_tab() j). col_type

    WHEN 1 THEN DBMS_SQL. DEFINE_COLUMN() c v_v_val j , 2000);

    WHEN 2 THEN DBMS_SQL. DEFINE_COLUMN() c v_n_val j );

    WHEN 12 THEN DBMS_SQL. DEFINE_COLUMN() c v_d_val j );

    ON THE OTHER

    DBMS_SQL. DEFINE_COLUMN() c v_v_val j , 2000);

    END CASE;

    END LOOP;

    -This section displays the header

    v_fh: = UTL_FILE. FOPEN (Upper (p_dir), p_header_file, 'w', 32767);

    FOR j 1. . col_cnt

    LOOP

    v_finaltxt := ltrim()v_finaltxt | «, » || down() rec_tab() j). column-name), ',');

    END LOOP;

    -DBMS_OUTPUT. Put_line ()v_finaltxt);

    UTL_FILE. Put_line ()v_fh, v_finaltxt);

    IF this is v_samefile THEN

    UTL_FILE. FCLOSE ()v_fh);

    END IF;

    --

    -This part generates the DATA

    IF this is v_samefile THEN

    v_fh: = UTL_FILE. FOPEN (Upper (p_dir), p_data_file, 'w', 32767);

    END IF;

    LOOP

    v_ret :=. DBMS_SQL C FETCH_ROWS();

    WHEN OUTPUT v_ret = 0;

    v_finaltxt := NULL;

    FOR j 1. . col_cnt

    LOOP

    CASE rec_tab() j). col_type

    WHEN 1 THEN DBMS_SQL. COLUMN_VALUE() c v_v_val j );

    v_finaltxt := ltrim("v_finaltxt |', ' ' | v_v_val |'" ',','");

    WHEN 2 THEN DBMS_SQL. COLUMN_VALUE() c v_n_val j );

    v_finaltxt := ltrim()v_finaltxt | «, » || v_n_val, ",");

    WHEN 12 THEN DBMS_SQL. COLUMN_VALUE() c v_d_val j );

    v_finaltxt: = ltrim (v_finaltxt |) ',' || TO_CHAR (v_d_val, ' DD/MM/YYYY HH24:MI:SS'), ',');

    ON THE OTHER

    v_finaltxt := ltrim("v_finaltxt |', ' ' | v_v_val |'" ',','");

    END CASE;

    END LOOP;

    -DBMS_OUTPUT. Put_line ()v_finaltxt);

    UTL_FILE. Put_line ()v_fh, v_finaltxt);

    END LOOP;

    UTL_FILE. FCLOSE ()v_fh);

    DBMS_SQL. C CLOSE_CURSOR();

    END;

    Proc call

    Exec run_query() ' SELECT d. DEBTORNO AS 'DebtorNo', d. Name NAME AS, d. MOTORCARRNO AS "MC # ', trunc()d. CREDEXPIREDATE) AS 'Expiring Credit Date', d. CREDEXPIREMOS AS 'Credit expires in many months' OF DEBTORS d WHERE d. CREDEXPIREMOS (3, 6, 9, 12) AND TRUNC()d. CREDEXPIREDATE) > = SysDate TRUNC()-1 AND d. NOBUYDESC is null AND (d. ) NOBUYDISPUTEKEY has the value NULL OR d. (NOBUYDISPUTEKEY = 0) order by 2 ',' Credit_reports ',' credit_exp.csv')

    Errors

    Error at startup on line 2 of the command:

    Error report:

    ORA-29283: invalid file operation

    ORA-06512: at «SYS. » UTL_FILE", line 536

    ORA-29283: invalid file operation

    ORA-06512: at "ABCBI. . RUN_QUERY', line 36

    ORA-06512: at line 1

    29283 00000 - "invalid file operation.

    * Cause: An attempt was made to read from a file or a directory which is

    not exist, or the file or directory access was denied by the

    operating system.

    * Action: Check access privileges to the file and directory on the file system

    and if reading, check that the file exists.

    Check first agree on this directory CREDIT_REPORTS

    Grant read, write on CREDIT_REPORTS for ;

    Second, try to create any file in ' / mnt/cifs/credit_report "by oracle at the level of the OS user and verify that you have access to do this.

    ----

    Ramin Hashimzade

  • read UTL_File, first record is missing

    Hello

    I read the text with UTL_FILE file to insert data in the staging table. For some reason any the first record to the text in inserting file is not in the table
    (Assume there are 10 records in text.file, except the very first record rest records is inserted successfully). Please help me on this.
    create or replace
    PROCEDURE PRC_XYZ_FILE_LOAD(
        p_in_file_name IN VARCHAR2,
        p_out_message OUT VARCHAR2)
    IS
     v_membernumber     whr_stageftd.membernumber%TYPE ;
      v_memberfullname   whr_stageftd.memberfullname%TYPE ;
     
     BEGIN
     --open files
      v_file_handler := UTL_FILE.FOPEN(v_file_path, v_file_name, 'r');
       UTL_FILE.GET_LINE(v_file_handler, v_text);
       LOOP
        BEGIN
             BEGIN
            UTL_FILE.GET_LINE(v_file_handler, v_text);
          EXCEPTION
          WHEN no_data_found THEN
            EXIT; -- end of file
          END;
          -------------------- Insert data in to whr_stageftd table -------------------------------
          v_detail_record              :=FNC_PIPE_PARSE (V_TEXT,1,'~');
           v_membernumber               :=FNC_PIPE_PARSE (V_TEXT,2,'~');
           v_memberfullname             :=FNC_PIPE_PARSE (V_TEXT,3,'~');
           v_stage:='stage3';
           v_locationid                 :=FNC_PIPE_PARSE (V_TEXT,4,'~');
           v_regionid                   :=FNC_PIPE_PARSE (V_TEXT,5,'~');
           v_transstartdate             :=FNC_PIPE_PARSE (V_TEXT,6,'~');
           v_transenddate               :=FNC_PIPE_PARSE (V_TEXT,7,'~');
                     
          IF v_detail_record            = '2' THEN
            INSERT
            INTO whr_stageftd
              (
                fileid ,
                membernumber ,
                memberfullname ,
                locationid,
                regionid,
                earningstartdate,
                earningenddate  )
              VALUES
              (
                v_fileid,
                v_membernumber,
                v_memberfullname,
                v_locationid,
                v_regionid,
                v_transstartdate ,
                v_transenddate);
            v_rec_counter := v_rec_counter + 1;
            IF mod(v_rec_counter,10000)= 0 THEN
              COMMIT;
            END IF;
          END IF;
        EXCEPTION
        WHEN OTHERS THEN
         dbms_output.put_line(Sqlerrm||v_stage);
          END;
      END LOOP;
       COMMIT;
      UTL_FILE.FCLOSE(v_file_handler);
     END PRC_XYZ_FILE_LOAD;
    Here's the code for FNC_PIPE_PARSE
    create or replace
    Function      FNC_PIPE_PARSE
     (p_instring in varchar2,
      p_field_no in number,
      p_delimiter in varchar2 default '|')
      RETURN varchar2 IS
     v_start number;
     v_no_of_chars number;
     v_instring varchar2(4000);
        v_delimiter_length NUMBER(10) := 0;
    BEGIN
    v_delimiter_length := length(p_delimiter);
    v_instring:=p_instring||p_delimiter;
    
      IF p_field_no = 1 THEN
         return(substr(v_instring,1,instr(v_instring,p_delimiter)-1));
      ELSE
       v_start := instr(v_instring,p_delimiter,1,p_field_no-1)+v_delimiter_length;
       v_no_of_chars := instr(v_instring,p_delimiter,1,p_field_no) - v_start;
     return(substr(v_instring,v_start,v_no_of_chars));
      END IF;
    END;
    examples of data
     actual data
    2~105266648J~C TEST~~~20050707~20050707
    2~104133506D~K TEST~~~20050707~20050707
    2~104929890I~A TEST~~~20050707~20050707
    2~104700166K~D TEST~~~20050708~20050708
    inserted into the table data (missing first record
    2~104133506D~K TEST~~~20050707~20050707
    2~104929890I~A TEST~~~20050707~20050707
    2~104700166K~D TEST~~~20050708~20050708
    SQLERRM error is
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small stage3
    Thank you
    Sandy

    Apparently, you do not specify the parameter len to GET_LINE, and the doc says:

    The parameter len GET_LINE must be a number in the range 1 to 32 767. If not specified, Oracle provides the default value of max_linesize.

    The FOPEN max_linesize parameter must be a number in the range 1 to 32 767. If not specified, Oracle provides a default value of 1024.

    Could it be the culprit?

    You should try to put some debugging in your code to find out what online content triggers the error.

  • Impossible to record in stereo microphone/line-in on Satellite P870-31N

    Hello

    I have a P870-31N (PSPLFE) I have bought recently, running Windows 8.

    Yesterday I connected my line of digital pianos to the line-in/microphone jack, using a stereo cable.

    I was unable, however, to get a stereo recording.

    I used the exact same configuration with another laptop (a Sony Vaio) and was able to record in stereo without any problem.

    I looked through all the options of the control panel for the realtek sound card, downloaded and installed the latest drivers from the Toshiba site, all to nothing does not.

    The manual indicates the 3.5 mm mini-plug lets you connect a mini-jack 3 drivers for stereo microphone input.

    Can someone tell me how to make this work?

    Thank you

    Hello

    I suppose that taking microphone laptop s does not support the feature line.

    3.5 mm on this laptop microphone allows the connection of a 3 drivers for stereo microphone input mini-jack.

    So you can plug in an external microphone into this Jack, but don t think you could use this and record the audio stream

  • should "Seek automatic line" process what?

    db11gxe, apex 4.0, firefox 24,

    Hi all, I do not understand what it should in fact?

    Otherwise, how will he know what line to select and display?  If look at the process, you will see that it is the page that contains the primary key for the table, so APEX expects this value to retrieve the row of data...

    Thank you

    Tony Miller

    Software LuvMuffin

  • L10: Deletion of records - should be easy or is it?

    Hi ive just brought a new satalite L10 and im having a problem with it. I can't do the simplest thing - when I create a new folder on my desktop or document folder and try to rename it or delete it - it won't work and the computer laptop everything freezes! In view of its new brand should not be a problem! Any suggestions?

    Hello

    It s a strange question. I never heard that after deleting a file from the laptop freezes.
    Have you tried to recover the operating system?
    I heard about a question, after that opening an html document the laptop came down. In this case, the motherboard had a flaw.
    Well. As a first step, you can try to pick you up the system if it doesn t work I suggest you contact the service partner.

    Good bye

  • Windows 7 - after an update, receive 'records should be checked for consistency.

    Since this update, when I start windows, I get a message saying disks should be checked for consistency. Messages to appear that I have create a restore but then disappear until I can read. Windows starts normally. My Norton diagnostic report said that there is a problem in the C: Partition.

    Thanks to all who responded, but I contacted support Norton and they have managed to solve the problem very quickly.

  • Impression on XPS Document Writer does not record anything

    When I try to print in XPS Document Writer, nothing is saved.  The dialog box appears asking you where I want to save it.  I select the folder, type a name and save it, but nothing is written.  There is no error message or anything. It is enough to save.  I tried several different applications (Firefox, IE, Word, Wordpad), but this does not seem to matter.

    One note, however, is that I can successfully print/save a test page to the printer (which makes it even more strange) properties.

    I'm on Windows 7 Ultimate 64-bit.

    Any help would be appreciated.

    * edit * I also tried to remove the device and add it again.  It does not either.

    After seeing your post, I decided to revisit this issue.  Apparently I've solved it.  My problem was that the files I tried to save to have full control to administrators, but not by my user explicitly.  To test this, I ran Firefox as an administrator, and I was able to save/print the XPS document.  This obviously isn't the most secure solution, so I just added my name explicitly under the Security tab for my home folder and propagate the changes down.  It seems that I can now save without problem (and run it as an administrator).

    It's not really make sense to me, since I belonged to the admin group.  It seems that the Windows UAC at least inspire you or something.  In any case, it's working for me now.  Hope that helps you.

  • FMS 3.5 recorded not playable on-line

    Hello

    I use 3 OUT broadcast and recording (DVR) for FMS 3.5 and the sample scripts DVR on FMS to record the live stream, but the recorded stream not playable (remote WFD with FLVPlayback and my FMS of local developer with Adobe Video Player too). The saved file broke down.

    What is the problem?

    I am grateful for!

    So are saying you things work now--if that's the case - well and good

  • multiple records in a single line

    Hi all

    I want to display all group codes that have the same name of the part,
    and I want to see all the codes of party in a line separated by commas. is this possible?

    Welcome to the forum.
    Without any data sample (create table + insert orders), I guess you'll find the techniques listed here:
    http://www.Oracle-base.com/articles/Misc/StringAggregationTechniques.php
    you go you.

  • TRIGGER TO RECORD WHEN SOMEONE ADDS LINES + 1 PASS MORE

    Hello

    Yes, I have this trigger that well adds the name of the user and timestamps (in audit_record_tb1) when it adds a line to another table.

    create or replace
    REGISTRO_ENTRADAS RELAXATION
    INSERT AFTER ASSESSMENT
    FOR EACH LINE
    BEGIN
    INSERT into audit_record_tb1 (user_value, date_recorded)
    values (sys_context ('userenv', 'current_user'),
    SYSDATE);
    END;

    But I need to be able to link, the link between these two data (user_value and date_recorded) at least one identifiable column of the table (to which he added a line) that would be the number of SS of that one. I know who said what and when.

    However, if I try to add another column to relax (after date_recorded and sysdate) I get this error.

    Error (9,10): PL/SQL: ORA-00984: column not allowed here

    Not here? where then? does anyone know where is the error?

    best thanks in advance

    Alvaro

    Published by: Alvaroe on November 29, 2009 15:02

    Alvaro:

    You can change the code to trigger as follows.

    create or replace
    TRIGGER REGISTRO_ENTRADAS
    AFTER INSERT ON EVALUATION
    FOR EACH ROW
    BEGIN
    insert into audit_record_tb1(user_value, date_recorded, rpsgb)
    values(sys_context('userenv','current_user'),sysdate, :new.rpsgb);
    END;
    

    For a trigger line, old and new columns of the trigger line values are available using the ': old 'and': new "rating as on the trigger.

    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14251/adfns_triggers.htm#sthref1218

    CITY

  • TRIGGER RECORDING WHEN SOMEONE ADDS LINES

    Hello

    I'm writing a trigger which will timestamp that adds rows to a table.


    I have to be close but developer sql tells me that I have not enough values... does anyone know what is missing here? my table has 3 passes, the pk, username and date_entered

    Thank you very much in advance

    CREATE OR REPLACE
    REGISTRAR_ENTRADAS RELAXATION
    INSERT AFTER ASSESSMENT
    FOR EACH LINE
    BEGIN
    insert into audit_record_tb1
    values (sys_content ('userenv', 'current_user'),
    SYSDATE);
    END;


    Alvaro

    The error you are getting means that there are more than 2 columns in the audit_record_tb1 table.
    Specify the column names:

    insert into audit_record_tb1(col1Name, col2Name)
    values(sys_content('userenv','current_user'),sysdate);
    

    Max

  • Using subquries to Apex report display muliple records in a single line

    How to display multiple values in one row and single column with sub query.

    Basically, a report that contains several rows with the columns and the columns contain still several values with sub quries.

    Shakur,

    See my response to your other thread...

    Otherwise, you could take the subquery and write it to a database of PL/SQL function that uses a cursor and return the HTML to display your results.

    Basically something like that.

    create function getData() return varchar2 is
    retval varchar2(4000);
    firsttime number;
    cursor c is ;
    begin
    firsttime := 1;
    retval := '';
    for x in c loop
    if firsttime = 1 then
    firsttime := 0;
    else
    retval := retval || '
    '; end if; retval := retval || x.field; end loop; return retval; end;

    You will need to ensure that the report is not set to strip HTML.

Maybe you are looking for

  • Satellite A110-195 - some Fn + keys do not work as before

    Recently, I disabled autostart apps and from that moment, the Fn + keys shown in the topic do not work as it should. First the message window does not appear for all keys function, including F6 and F7 for example, but also they work properly - the br

  • I lost my satellite A210-171 Vista

    I put Ubuntu on my system at the start of the duel... but I gave it to my father in the end for me while I've done a few things for him... it install on my vista that came with my a210... I tried to acess the recovery partition with no luck, then I i

  • 2.7.3 NI-CAN install

    I downloaded the NI-CAN 2.7.3 file OR install the drivers of the CAN and screw in my software LabVIEW 2011 SP1 already on the machine, a 32-bit computer, all went well with the VIs CAN appear in the menu of the e/s to measure exactly functions as exp

  • Pavilion dv6t-7000: upgrading DV6t - 7000 HD for SSD

    Hi all I think to upgrade my hard drive to an SSD. I have a 640 GB SATA drive with form factor of 2.5 "X 1/8 h. I would appreciate if you could recommend an SSD compatible with more storage capacity of 160 GB and a guide on how to install it." Thank

  • Update Windows automatically restarts the computer. I would like to disable this feature.

    Update Windows automatically restarts the computer. I would like to disable this feature. I'm running a machine business with complex projects requiring a configuration long and delicate. The details below:Type of operating system: Windows 7 Ultimate