Replace in UTL_FILE

Hi
I create a text file using UTL_FILE and write some data on it, before close the file I need replace some characters on the file with a value, How could I do this.
Thank you
Richie

If you can't replace the characters before writing to a file, write a C or any other program and execute this program after closing the file.
rgds

Similar Messages

  • To read text file using utl_file

    I would like to read test_file_out.txt which is in c:\temp folder.
    create or replace create or replace directory dir_temp as 'c:\temp';
    grant read, write on directory dir_temp to system;
    then when i execute the below code i get the error .
    // to read text file using utl_file
    DECLARE
    FileIn UTL_FILE.FILE_TYPE;
    v_sql VARCHAR2 (1000);
    BEGIN
    FileIn := UTL_FILE.FOPEN ('DIR_TEMP', 'test_file_out.txt', 'R');
    UTL_FILE.PUT_LINE (FileIn, v_sql);
    dbms_output.put_line(v_sql);
    UTL_FILE.FCLOSE (FileIn);
    END;
    ERROR:
    invalid file operation
    i would like to use ult_file only and also can you let me know to read the text file and place its contents in tmp_emp table?

    Are you trying to read the contents of the file into the local variable? Or write the contents of the local variable to the file?
    Your text talks about reading the file. And you open the file in read mode. But then you call the UTL_FILE.PUT_LINE method which, as SomeoneElse points out, attempts to write data to the file. Since the file is open in read-only mode, you cannot write to the file.
    If the goal is really to read from the file, replace the UTL_FILE.PUT_LINE calls with UTL_FILE.GET_LINE. If the goal is really to write to the file, you'll need to open the file in write mode ('W' rather than 'R' in the FOPEN call).
    Justin

  • Not getting Result please Help

    Hi All
    query_string VARCHAR2(2000);
    query_string are EMPNO,ENAME
    for rec1 in (SELECT query_string FROM p_table_name ) loop
    utl_file.put_line(v_file, rec1.result1);
    END LOOP;
    not getting Result please Help
    Regards

    You may look at this:
    michaels>  DECLARE
       cur            sys_refcursor;
       query_string   VARCHAR2 (2000) := '';
       p_table_name   VARCHAR2 (30)   := UPPER ('emp');
       p_stmt         LONG;
    BEGIN
       FOR c IN (SELECT ROWNUM rn, column_name, COUNT (*) OVER () cnt
                   FROM user_tab_cols
                  WHERE table_name = p_table_name AND hidden_column = 'NO')
       LOOP
          query_string :=
             query_string || c.column_name
             || CASE
                WHEN c.rn != c.cnt
                   THEN ' || ''|'' || '
             END;
       END LOOP;
       p_stmt := 'select ' || query_string || ' FROM ' || p_table_name;
    -- DBMS_OUTPUT.put_line (p_stmt);
       OPEN cur FOR p_stmt;
       FOR rec1 IN (SELECT EXTRACTVALUE (t.COLUMN_VALUE, '/ROW//text()') result1
                      FROM TABLE (XMLSEQUENCE (cur)) t)
       LOOP
          /*  replace with utl_file in case ... */
          DBMS_OUTPUT.put_line (rec1.result1);
       END LOOP;
       CLOSE cur;
    END;
    7369|SMITH|CLERK|7902|17-DEC-80|800||20
    7499|ALLEN|SALESMAN|7698|20-FEB-81|1600|300|30
    7521|WARD|SALESMAN|7698|22-FEB-81|1250|500|30
    7566|JONES|MANAGER|7839|02-APR-81|2975||20
    7654|MARTIN|SALESMAN|7698|28-SEP-81|1250|1400|30
    7698|BLAKE|MANAGER|7839|01-MAY-81|2850||30
    7782|CLARK|MANAGER|7839|09-JUN-81|2450||10
    7788|SCOTT|ANALYST|7566|19-APR-87|3000||20
    7839|KING|PRESIDENT||17-NOV-81|5000||10
    7844|TURNER|SALESMAN|7698|08-SEP-81|1500|0|30
    7876|ADAMS|CLERK|7788|23-MAY-87|1100||20
    7900|JAMES|CLERK|7698|03-DEC-81|950||30
    7902|FORD|ANALYST|7566|03-DEC-81|3000||20
    7934|MILLER|CLERK|7782|23-JAN-82|1300||10
    PL/SQL procedure successfully completed.

  • Create a Multiple Files using PL-SQL

    Hi Experts,
    I have a table which contains 360 records and want to create multiple files with each file containing 12 records.
    I tried to use the below code, however was unsuccessfull..
    Please help!!!!
    DECLARE
       num      NUMBER             := 1;
       f_file   UTL_FILE.file_type;
       row_sm   NUMBER             := 0.00;
    CURSOR c_cur
       IS
          SELECT   customer_key, all_columns_concat
              FROM demo;
    c_rec    c_cur%ROWTYPE;
    BEGIN
       OPEN c_cur;
       LOOP
          FETCH c_cur
           INTO c_rec;
         EXIT WHEN c_cur%NOTFOUND;
          WHILE num = c_rec.file_num
          LOOP
             f_file := UTL_FILE.fopen ('DM_DIR', 'FILE_' || num, 'w', 3267);
             num := num + 1;
          END LOOP;
          UTL_FILE.put_line (f_file, c_rec.all_columns_concat);
          row_sm := c_rec.sum_row + row_sm;
       END LOOP;
       UTL_FILE.fclose (f_file);
      CLOSE c_cur;
    END;
    Regards,
    RaviR.

    Thanks Ramin,
    Your Code really helped. I am now not getting no errors and files are also being created. However, if I replace the UTL_FILE with DBMS_OUTPUT, I get below output. In your code i replaced 12 with 3. Hence its dividing after 3 rows. (with 1st row duplicated)
    Output
    1
    1
    2
    3
    ========================================
    4
    4
    5
    6
    ========================================
    7
    7
    8
    9
    ========================================
    10
    10
    11
    12
    ========================================
    13
    13
    14
    15
    ========================================
    16
    16
    Now my concern is that i my table I have a flag which determines the seperation...
    Column1
    File_Num
    1
    1
    2
    1
    3
    1
    4
    2
    5
    2
    6
    2
    7
    3
    8
    3
    9
    3
    10
    3
    11
    3
    Hence if the file_Num is 1 it will go to File1, file_num=2 will be written to File2 and so on.
    Please help me to get this logic.
    Thanks in advance.
    Regards,
    RaviR

  • (ORA-06508: PL/SQL: could not find program unit being called) utl_file

    hi all,
    I am using Oracle XE and forms 6i and am facing the above error when i try to use the utl_file utility.
    WHEN BUTTOn PRESSED
         IF (:EXPORT_IMPORT_DATA = 'E') THEN
              message(lc_status);
                             SECURITY.PKG_gen_trnsfr_data_flat_file.PROC_gen_trnsfr_data_flat_file(:DATA_FILE_PATH, :DATA_FILE_NAME, lc_status);
    PKG_GEN_TRNSFR_DATA_FLAT_FILE body
    create or replace PACKAGE BODY PKG_gen_trnsfr_data_flat_file IS
    PROCEDURE proc_gen_trnsfr_data_flat_file(p_file_location IN VARCHAR2, p_file_name IN VARCHAR2, po_status OUT VARCHAR2) IS
         lh_filename UTL_FILE.FILE_TYPE;
         ls_data VARCHAR2(2000);
         ln_count NUMBER;
         lc_error VARCHAR2(10000);
    CURSOR cur_FPM_DAMAGE_COMPENSATION IS SELECT RPAD(nvl(PDCO_CASE_CLASS,' '),1) || RPAD(nvl(PDCO_CASE_DISPOSAL_PENDING,' '),1) || RPAD(nvl(PDCO_CASE_DISPOSAL_TYPE,' '),1) || RPAD(nvl(PDCO_CC_NO,0),9) || RPAD(nvl(PDCO_CF_NO,0),9) || RPAD(nvl(PDCO_COMPEN_REALISED,0),18) || RPAD(nvl(PDCO_CONFISCATED_PRODUCE,' '),25) || RPAD(nvl(PDCO_CR_NO,0),9) || RPAD(nvl(PDCO_DAMAGE_DETAILS,' '),90) || RPAD(nvl(PDCO_DAMAGE_REPORT_NO,0),13) || RPAD(NVL(TO_CHAR(PDCO_DATE_ORDER_COMPOUNDING,'DD-MON-RRRR'),' '),15) || RPAD(NVL(TO_CHAR(PDCO_DATE_PROSECUTION,'DD-MON-RRRR'),' '),15) || RPAD(NVL(TO_CHAR(PDCO_DISPOSAL_DATE,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PDCO_DR_NO,0),9) || RPAD(nvl(PDCO_FOREST_NAME,' '),50) || RPAD(NVL(TO_CHAR(PDCO_ISSUE_DATE,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PDCO_LASTUPDATE_BY,' '),30) || RPAD(NVL(TO_CHAR(PDCO_LASTUPDATE_ON,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PDCO_NO_OF_PERSONS_IN_THE_CASE,0),6) || RPAD(nvl(PDCO_NO_ORDER_FOR_COMPOUNDING,' '),15) || RPAD(nvl(PDCO_OFFENCE_DETAILS,' '),90) || RPAD(nvl(PDCO_OFFENCE_TYPE,' '),1) || RPAD(nvl(PDCO_OFFENDER_ADDRESS,' '),90) || RPAD(nvl(PDCO_OFFENDER_NAME,' '),200) ||
    RPAD(nvl(PDCO_OFFICIAL_NAME,' '),30) || RPAD(nvl(PDCO_RA_SIGN,' '),30) || RPAD(NVL(TO_CHAR(PDCO_RA_SIGN_DATE,'DD-MON-RRRR'),' '),15) || RPAD(NVL(TO_CHAR(PDCO_RECEIPT_DATE,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PDCO_RR_NO,0),18) || RPAD(nvl(PDCO_TOOLS,0),18) || RPAD(nvl(PDCO_TOTAL,0),18) || RPAD(nvl(PDCO_VALUE_CONFISCATED_PROD,0),18) || RPAD(nvl(PDCO_VFP,0),18) || RPAD(nvl(PDCO_YDIV_DIVISION_CODE,' '),8) || RPAD(nvl(PDCO_YRAN_RANGE_CODE,' '),8) outstring FROM FPM_DAMAGE_COMPENSATION;
    CURSOR cur_FPM_DAMAGE_COMPENSATION_R IS SELECT RPAD(nvl(CIRCLE,' '),90) || RPAD(nvl(DIVISION,' '),90) || RPAD(nvl(PREV_A,0),9) || RPAD(nvl(PREV_B,0),9) || RPAD(nvl(PREV_TOTAL,0),11) || RPAD(nvl(TOT_A,0),11) || RPAD(nvl(TOT_B,0),11) || RPAD(nvl(TOT_C,0),11) || RPAD(nvl(T_A,0),9) || RPAD(nvl(T_B,0),9) || RPAD(nvl(T_C,0),9) || RPAD(nvl(X_A,0),9) || RPAD(nvl(X_B,0),9) || RPAD(nvl(X_C,0),9) || RPAD(nvl(Y_A,0),9) || RPAD(nvl(Y_B,0),9) || RPAD(nvl(Y_C,0),9) || RPAD(nvl(Z_A,0),9) || RPAD(nvl(Z_B,0),9) || RPAD(nvl(Z_C,0),9) outstring FROM fpm.FPM_DAMAGE_COMPENSATION_R;
    CURSOR cur_FPM_ENCROACHMENT IS SELECT RPAD(nvl(PENC_AREA_UNDER_ENCROACH,0),18) || RPAD(nvl(PENC_BALANCE_AREA_UN_ENC,0),18) || RPAD(nvl(PENC_ENCROACH_ID,' '),8) || RPAD(nvl(PENC_FOREST_NAME,' '),50) || RPAD(nvl(PENC_LASTUPDATE_BY,' '),30) || RPAD(NVL(TO_CHAR(PENC_LASTUPDATE_ON,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PENC_LEGAL_STATUS_OF_FOREST,' '),90) || RPAD(NVL(TO_CHAR(PENC_PERIOD_FROM_UNDER_ENC,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PENC_PRESENT_STATUS,' '),90) || RPAD(nvl(PENC_YDIV_DIVISION_CODE,' '),8) outstring FROM FPM_ENCROACHMENT;
    CURSOR cur_FPM_ENCROACHMENT_REMOVALS IS SELECT RPAD(nvl(PENR_ACTION_TAKEN,' '),90) || RPAD(nvl(PENR_AREA_REMOVED_ENCMNT,0),18) || RPAD(NVL(TO_CHAR(PENR_DATE,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PENR_LASTUPDATE_BY,' '),30) || RPAD(NVL(TO_CHAR(PENR_LASTUPDATE_ON,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PENR_PENC_ENCROACHMENT_ID,' '),8) || RPAD(nvl(PENR_PENC_YDIV_DIVISION_CODE,' '),8) outstring FROM FPM_ENCROACHMENT_REMOVALS;
    CURSOR cur_FPM_FIRE IS SELECT RPAD(nvl(PFIR_ACTION_TAKEN,' '),90) || RPAD(nvl(PFIR_AREA_EFFECTED,0),18) || RPAD(nvl(PFIR_CAUSE_OF_FIRE,' '),2) || RPAD(nvl(REPLACE(REPLACE(PFIR_DAMAGE_DETAILS,CHR(13),' '),CHR(10),' '),' '),200) || RPAD(nvl(PFIR_DAMAGE_VALUE,0),18) || RPAD(NVL(TO_CHAR(PFIR_DATE_OF_FIRE,'DD-MON-RRRR'),' '),15) || RPAD(NVL(TO_CHAR(PFIR_DATE_VISIT_DFO,'DD-MON-RRRR'),' '),15) || RPAD(NVL(TO_CHAR(PFIR_DATE_VISIT_RANGEOFFICER,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PFIR_DFO_COMMENTS,' '),90) || RPAD(nvl(PFIR_DFO_SIGN,' '),30) || RPAD(NVL(TO_CHAR(PFIR_DFO_SIGN_DATE,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PFIR_FIRE_NO,' '),10) || RPAD(nvl(PFIR_FOREST_NAME,' '),50) || RPAD(nvl(PFIR_LASTUPDATE_BY,' '),30) || RPAD(NVL(TO_CHAR(PFIR_LASTUPDATE_ON,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PFIR_NO_OF_TREES,0),18) || RPAD(nvl(PFIR_QTY_OTH_FORST_PROD_BRNT,0),18) || RPAD(nvl(PFIR_RANGEOFFICER_COMMENTS,' '),90) || RPAD(nvl(PFIR_REPORTING_PERSON,' '),30) || RPAD(nvl(PFIR_VALUE_OTH_FORST_PROD_BRNT,0),18) || RPAD(nvl(PFIR_VALUE_TREES_BURNT,0),18) || RPAD(nvl(PFIR_VOLUME_TREES_BURNT,0),18) || RPAD(nvl(PFIR_YDIV_DIVISION_CODE,' '),8) || RPAD(nvl(PFIR_YRAN_RANGE_CODE,' '),8) outstring FROM FPM_FIRE;
    CURSOR cur_FPM_JFM_MASTER IS SELECT RPAD(nvl(PJFM_BSCM_SCHEME_CODE,' '),8) || RPAD(nvl(PJFM_JFM_ID,0),13) || RPAD(nvl(PJFM_LASTUPDATE_BY,' '),30) || RPAD(NVL(TO_CHAR(PJFM_LASTUPDATE_ON,'DD-MON-RRRR'),' '),15) || RPAD(NVL(TO_CHAR(PJFM_LAUNCH_DATE,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PJFM_LOCATION,' '),20) || RPAD(nvl(PJFM_YDIV_DIVISION_CODE,' '),8) outstring FROM FPM_JFM_MASTER;
    CURSOR cur_FPM_JFM_DETAILS IS SELECT RPAD(NVL(TO_CHAR(PJFD_DATE,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PJFD_EXPENDITURE,0),18) || RPAD(nvl(PJFD_LASTUPDATE_BY,' '),30) || RPAD(NVL(TO_CHAR(PJFD_LASTUPDATE_ON,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PJFD_NO_OF_FPS,0),13) || RPAD(nvl(PJFD_OTHER_AREA_INCLUDED,0),18) || RPAD(nvl(PJFD_OVERALL_AREA_REGENERATED,0),18) || RPAD(nvl(PJFD_PF_AREA_INCLUDED,0),18) || RPAD(nvl(PJFD_PJFM_JFM_ID,0),13) || RPAD(nvl(PJFD_RF_AREA_INCLUDED,0),18) || RPAD(nvl(PJFD_VALUE_BENEFIT_CASH,0),18) || RPAD(nvl(PJFD_VALUE_BENEFIT_GOODS,0),18) outstring FROM FPM_JFM_DETAILS;
    CURSOR cur_FPM_PROTECTION_FIRE_MASTER IS SELECT RPAD(nvl(PPFM_AREA_ATTEM_TO_BE_PROT,0),18) || RPAD(nvl(PPFM_FINANCIAL_YEAR,' '),9) || RPAD(nvl(PPFM_LASTUPDATE_BY,' '),30) || RPAD(NVL(TO_CHAR(PPFM_LASTUPDATE_ON,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PPFM_YDIV_DIVISION_CODE,' '),8) outstring FROM FPM_PROTECTION_FIRE_MASTER;
    CURSOR cur_FPM_PROTECTION_FIRE_DET IS SELECT RPAD(nvl(PPFD_AREA_ACTUALLY_PROTECTED,0),18) || RPAD(nvl(PPFD_COST,0),18) || RPAD(nvl(PPFD_FAILURE,0),18) || RPAD(nvl(PPFD_LASTUPDATE_BY,' '),30) || RPAD(NVL(TO_CHAR(PPFD_LASTUPDATE_ON,'DD-MON-RRRR'),' '),15) || RPAD(nvl(PPFD_PPFM_FINANCIAL_YEAR,' '),9) || RPAD(nvl(PPFD_PPFM_YDIV_DIVISIN_CODE,' '),8) outstring FROM FPM_PROTECTION_FIRE_DETAILS;
    BEGIN
    lc_error := 'begin';
    lc_error := p_file_location || p_file_name ;
         lh_filename := UTL_FILE.FOPEN(p_file_location, p_file_name, 'w',32767);
    lc_error := 'filename';
         SELECT COUNT(*) INTO ln_count FROM FPM_DAMAGE_COMPENSATION;
         lc_error := 'line 1';
         UTL_FILE.PUT_LINE(lh_filename, RPAD(ln_count,10) || 'FPM_DAMAGE_COMPENSATION');
         lc_error := 'line2';
         FOR i IN cur_FPM_DAMAGE_COMPENSATION LOOP
         UTL_FILE.PUT_LINE(lh_filename, i.outstring);
         END LOOP;
         SELECT COUNT(*) INTO ln_count FROM fpm.FPM_DAMAGE_COMPENSATION_R;
         UTL_FILE.PUT_LINE(lh_filename, RPAD(ln_count,10));
         FOR i IN cur_FPM_DAMAGE_COMPENSATION_R LOOP
         UTL_FILE.PUT_LINE(lh_filename, i.outstring);
         END LOOP;
         SELECT COUNT(*) INTO ln_count FROM FPM_FIRE;
         UTL_FILE.PUT_LINE(lh_filename, RPAD(ln_count,10)||'FPM_FIRE');
         FOR i IN cur_FPM_FIRE LOOP
         UTL_FILE.PUT_LINE(lh_filename, i.outstring);
         END LOOP;
         SELECT COUNT(*) INTO ln_count FROM FPM_JFM_MASTER;
         UTL_FILE.PUT_LINE(lh_filename, RPAD(ln_count,10));
         FOR i IN cur_FPM_JFM_MASTER LOOP
         UTL_FILE.PUT_LINE(lh_filename, i.outstring);
         END LOOP;
         SELECT COUNT(*) INTO ln_count FROM FPM_JFM_DETAILS;
         UTL_FILE.PUT_LINE(lh_filename, RPAD(ln_count,10));
         FOR i IN cur_FPM_JFM_DETAILS LOOP
         UTL_FILE.PUT_LINE(lh_filename, i.outstring);
         END LOOP;
         SELECT COUNT(*) INTO ln_count FROM FPM_PROTECTION_FIRE_MASTER;
         UTL_FILE.PUT_LINE(lh_filename, RPAD(ln_count,10));
         FOR i IN cur_FPM_PROTECTION_FIRE_MASTER LOOP
         UTL_FILE.PUT_LINE(lh_filename, i.outstring);
         END LOOP;
         SELECT COUNT(*) INTO ln_count FROM FPM_PROTECTION_FIRE_DETAILS;
         UTL_FILE.PUT_LINE(lh_filename, RPAD(ln_count,10));
         FOR i IN cur_FPM_PROTECTION_FIRE_DET LOOP
         UTL_FILE.PUT_LINE(lh_filename, i.outstring);
         END LOOP;
         SELECT COUNT(*) INTO ln_count FROM FPM_ENCROACHMENT;
         UTL_FILE.PUT_LINE(lh_filename, RPAD(ln_count,10));
         FOR i IN cur_FPM_ENCROACHMENT LOOP
         UTL_FILE.PUT_LINE(lh_filename, i.outstring);
         END LOOP;
         SELECT COUNT(*) INTO ln_count FROM FPM_ENCROACHMENT_REMOVALS;
         UTL_FILE.PUT_LINE(lh_filename, RPAD(ln_count,10));
         FOR i IN cur_FPM_ENCROACHMENT_REMOVALS LOOP
         UTL_FILE.PUT_LINE(lh_filename, i.outstring);
         END LOOP;
         UTL_FILE.FCLOSE_ALL;
         po_status := 'NO ERROR';      
         EXCEPTION
                   WHEN UTL_FILE.INVALID_PATH      OR UTL_FILE.INVALID_MODE THEN
                                       po_status := 'I 1';
                   WHEN UTL_FILE.INVALID_FILEHANDLE OR UTL_FILE.INVALID_OPERATION OR UTL_FILE.INTERNAL_ERROR OR UTL_FILE.WRITE_ERROR THEN
                                       po_status := 'I 2';
                   WHEN OTHERS THEN
                                       po_status := lc_error;
                                       LC_ERROR:='I 4';
                                       dbms_output.put_line(LC_ERROR);
    END;
    END;
    If i uncomment UTL_FIle.Fopen statement, the error text will be the path name and file name.
    Can anyone advise as to what should be done to resolve this on XE. It worked fine on 8i.
    I have runcatproc.sql and utlfile.sql also
    regards
    kunal

    Hi
    On 8i you would have set the UTL_DIR_PATH parameter
    in the init.ora file. Did you do this for your XE
    database? I hope you are referring to the UTL_FILE_DIR parameter. I have set this parameter to value *.
    Although the better approach would be to
    create a directory object for the file path, an
    option which was introduced in 9i..
    Can you please elaborate me on this. I tried declaring the create directory statement in the package, but that didnt help. I have already created one through sql command line. How can i use this directory as an alternative to utl_file

  • Problem with UTL_FILE (please see my last post on this thread)

    Hi all,
    I'm trying to get the code (procedures, functions, etc) of my schemas. I've tried it using DBMS_METADATA.GET_DDL but it fails with many objects. Finally, I'm trying to create a procedure to extract the code.
    I've created this two procedures:
    CREATE OR REPLACE PROCEDURE spool_code (code IN varchar2, propi IN varchar2) is
    CURSOR codigo is
    select text from dba_source where name = code and owner = propi order by line;
    line varchar2(4000);
    BEGIN
    open codigo;
    loop
    fetch codigo into line;
    exit when codigo%notfound;
    dbms_output.put_line(line);
    end loop
    close;
    END;
    CREATE OR REPLACE PROCEDURE ext_codigo is
    CURSOR objeto is
    select object_name, owner from dba_objects where object_type in ('PROCEDURE','FUNCTION','PACKAGE')
    and owner not in ('OUTLN','DBSNMP','SYSTEM','SYS','REPADMIN','PERFSTAT','SPOTLIGHT','MONITOR','PRUEBAS','TOAD')
    and status='VALID';
    nom varchar2(128);
    owner varchar2(30);
    BEGIN
    open objeto;
    loop
    fetch objeto into nom, owner;
    exit when objeto%notfound;
    spool_code(nom, owner);
    end loop;
    close objeto;
    END;
    And I'm calling from sqlplus to spool it:
    SQL> spool Users_code.sql
    SQL> exec ext_codigo;
    But it don't bring me results...
    where is the problem??
    Thanks in advance for your support!
    dbajug
    Edited by: dbajug on Aug 29, 2012 6:36 AM

    Hi,
    yes guys, I've set serverout on using the max limit but, always fails with:
    ERROR at line 1:
    ORA-20000: ORU-10027: buffer overflow, limit of 1000000 bytes
    ORA-06512: at "SYS.DBMS_OUTPUT", line 35
    ORA-06512: at "SYS.DBMS_OUTPUT", line 198
    ORA-06512: at "SYS.DBMS_OUTPUT", line 139
    ORA-06512: at "SYS.SPOOL_CODE", line 15
    ORA-06512: at "SYS.EXT_CODIGO", line 17
    ORA-06512: at line 1
    I'm working with a 9i version trying to extract the code to migrate it to a 11g.
    In order to avoid the buffer error, I've decide use the UTL_FILE package but I'm having another problem: my procedure now is this
    CREATE OR REPLACE PROCEDURE spool_code (code IN varchar2, propi IN varchar2) is
    CURSOR codigo is
    select text from dba_source where name = code and owner = propi order by line;
    line varchar2(4000);
    out_file UTL_FILE.File_Type;
    BEGIN
    begin
    out_file := UTL_FILE.Fopen('/export/home/oracle', 'Users_code.sql', 'w');
    exception
    when others then
    dbms_output.put_line('Error opening file');
    end;
    open codigo;
    loop
    fetch codigo into line;
    exit when codigo%notfound;
    UTL_FILE.Put_Line(out_file, line);
    end loop;
    close codigo;
    UTL_FILE.Fclose(out_file);
    END;
    The directory exists and the file too but fails with this error:
    ERROR at line 1:
    **ORA-29282: invalid file ID**
    ORA-06512: at "SYS.UTL_FILE", line 714
    ORA-06512: at "SYS.SPOOL_CODE", line 23
    ORA-06512: at "SYS.EXT_CODIGO", line 17
    ORA-06512: at line 1
    any idea? about the reason? The file is a text file on the server:
    ls -lrt /export/home/oracle/Users_code.sql
    -rw-rw-r-- 1 oracle dba 0 Aug 29 14:43 /export/home/oracle/Users_code.sql
    best regards,
    dbajug

  • How do I use UTL_FILE to insert a large number of fields to a file?

    Hi
    I am trying to use UTL_FILE for the first time in a Stored Procedure. I need to run a complex query to select 50 fields from various tables. I need these to be inserted into one line in the output file for all rows. Is this possible? My procedure so far is like the following
    CREATE OR REPLACE PROCEDURE PROC_TEST IS
    output_file UTL_FILE.FILE_TYPE;
    BEGIN
    FOR query in (SELECT FIELD1, FIELD2, ..........FIELD50)
    FROM TABLE A, TABLE B
    WHERE A.ID = B.ID
    ETC
    LOOP
    UTL_FILE.PUT_LINE(output_file, <put all 50 fields for all records into file> );
    END LOOP;               
    UTL_FILE.FCLOSE (output_file);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    WHEN OTHERS THEN
         UTL_FILE.FCLOSE_ALL;
    RAISE;
    END PROC_TEST;
    Do I need to define 'query' (after the FOR) anywhere, also please advise with how I put all of the fields into the file.
    Thanks
    GB

    Thanks Steve,
    I have the UTL_FILE working fine now.
    I have other queries to run and conditions to apply in the same procedure, and I need to schedule via Enterprise Manager, therefore using UTL_FILE in a procedure seemed the best option. I looked up Data-pump but this seems to be an 11g feature, and we are still on 10g therefore I will not be able to use it.
    Thanks for your help.
    GB

  • How to replace the string in a file

    Hi, I have a file which contains the following data
    File.dat
    <file>
    <filenum>
    W10
    </filenum>
    <hello>Heading </hello>
    </file>
    I need to replace the contents of file.dat
    database sequence value (for example xx_seq.nextval)
    Can some one please tell me how to search this <filenum>
    W10</filenum>
    and replace this with xx_seq.nextval
    and write the entire contents of the file to new file
    I am doing some thing like this
    suppose if my database value returns 11 from the above sequence then
    the output should be in file2.dat as
    <file>
    <filenum>
    11</filenum>
    <hello>Heading </hello>
    </file>
    declare f_in utl_file.file_type;
    s_in varchar2(10000);
    string1 varchar2(32000);
    x number;
    begin
    f_in := utl_file.fopen('SAMPLEDIR','input.txt','R');
    f_in1 := utl_file.fopen('SAMPLEDIR','input1.txt','W');
    select xx_seq.nextval into x from dual;
    loop
    begin utl_file.get_line(f_in,s_in);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    EXIT;
    string1:= string1 || s_in;
    utl_file.put_line( (f_in1,s_in);
    end;
    end loop;
    utl_file.fclose(f_in);
    end;
    In this case it is reading and writing as it is, but unable to replace the sequence value
    Can some one please tell me how to do using replace function
    Thanks

    Hi, I have tried this but getting error
    step 1: create table test_dept(dno number, dname varchar2(20))
    insert into test_dept values(10,'10-Sourcing dept');
    insert into test_dept values(20,'20-Audting dept');
    insert into test_dept values(30,'30-Computer dept');
    select * from test_dept;
    DNO DNaME
    10     10-Sourcing dept
    30     30-Computer dept
    20     20-Audting dept
    step 2:
    create table test_web (name varchar2(60), xml_col xmltype) ;
    step 3:
    create sequence test1_seq start with 100 increment by 1
    step 4:
    test.out has the following contents (it is not .xml file) and i dont have <?xml version="1.0" ?> tag at the begining
    <File>
    <File_Type>Type1</File_Type>
    <File_Header_Record>
    <file_num>WP10</file_num>
    </File_Header_Record>
    <Transaction>
    <Transaction_Type>TR 1</Transaction_Type>
    <Amount>
    <Amounts>100</Amounts>
    </Amount>
    <Depts>
    <Dept_Type>Sourcing</Dept_Type>
    <Dept>10</Dept>
    </Depts>
    </Transaction>
    <Transaction>
    <Transaction_Type>TR 2</Transaction_Type>
    <Amount>
    <Amounts>200</Amounts>
    </Amount>
    <Depts>
    <Dept_Type>Auditing</Dept_Type>
    <Dept>20</Dept>
    </Depts>
    </Transaction>
    <Transaction>
    <Transaction_Type>TR 3</Transaction_Type>
    <Amount>
    <Amounts>300</Amounts>
    </Amount>
    <Depts>
    <Dept_Type>Computer</Dept_Type>
    <Dept>30</Dept>
    </Depts>
    </Transaction>
    </File>
    step 5:
    DECLARE
    v_check_file_exist BOOLEAN;
    v_file_length NUMBER;
    v_block_size NUMBER;
    v_file_path VARCHAR2 (100);
    v_file_name VARCHAR2 (100);
    v_file_type UTL_FILE.FILE_TYPE;
    v_str varchar2 (32760);
    v_cnt number;
    v_seq number;
    --check whether file exists and has data in it
    BEGIN
    v_file_path := '/usr/tmp';
    v_file_name := 'test.xml.out';
    -- initailise the variables
    v_cnt := 0;
    UTL_FILE.FGETATTR (v_file_path,
    v_file_name,
    v_check_file_exist,
    v_file_length,
    v_block_size);
    if v_check_file_exist
    then
    DBMS_OUTPUT.put_line (' File exists');
    IF v_file_length > 0 AND v_block_size > 0
    THEN
    BEGIN
    select test1_seq.nextval into v_seq from dual;
    insert into test_web values(v_seq,v_file_name);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    DBMS_OUTPUT.put_line ('No data found '||SQLERRM);
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ('others '||SQLERRM);
    END;
    commit;
    ELSE
    DBMS_OUTPUT.put_line ('No Data in File');
    END IF;
    ELSE
    DBMS_OUTPUT.put_line (' File Not Available');
    END IF;
    END;
    I am getting below error
    File exists
    others ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML
    processing
    LPX-00210: expected '<' instead of 't'
    Error at line 1
    My requirement is to replace the
    1. contents of the file WP10 from <file_num>WP10</file_num>
    with sequence value 'WP101' because sequence is starting at 100
    2. Replace all Dept tag <Dept>30</Dept> with Dname value from test_dept table
    for example
    <Dept>10</Dept> should be replaced with <Dept>10-Sourcing dept</Dept>
    update the
    when i say select * from test_web;
    It should contain this row
    101 <File>
    <File_Type>Type1</File_Type>
    <File_Header_Record>
    <file_num>WP101</file_num>
    </File_Header_Record>
    <Transaction>
    <Transaction_Type>TR 1</Transaction_Type>
    <Amount>
    <Amounts>100</Amounts>
    </Amount>
    <Depts>
    <Dept_Type>Sourcing</Dept_Type>
    <Dept>10-Sourcing dept</Dept>
    </Depts>
    </Transaction>
    <Transaction>
    <Transaction_Type>TR 2</Transaction_Type>
    <Amount>
    <Amounts>200</Amounts>
    </Amount>
    <Depts>
    <Dept_Type>Auditing</Dept_Type>
    <Dept>20-Audting dept</Dept>
    </Depts>
    </Transaction>
    <Transaction>
    <Transaction_Type>TR 3</Transaction_Type>
    <Amount>
    <Amounts>300</Amounts>
    </Amount>
    <Depts>
    <Dept_Type>Computer</Dept_Type>
    <Dept>30-Computer dept</Dept>
    </Depts>
    </Transaction>
    </File>
    Can you please check
    Thanks

  • HOW TO READ DATA FROM A FILE AND INSERT INTO A TABLE USING UTL_FILE

    Hi..
    I have a file.I want to read the data from file and load it into a table using utl_file.
    how can I do it?
    Any reply apreciated...

    Hi,
    This is not your requirment but u can try this :
    CREATE OR REPLACE DIRECTORY text_file AS 'D:\TEXT_FILE\';
    GRANT READ ON DIRECTORY text_file TO fah;
    GRANT WRITE ON DIRECTORY text_file TO fah;
    DROP TABLE load_a;
    CREATE TABLE load_a
    (a1 varchar2(20),
    a2 varchar2(200))
    ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY text_file
    ACCESS PARAMETERS
    (FIELDS TERMINATED BY ','
    LOCATION ('data.txt')
    select * from load_a;
    CREATE TABLE A AS select * from load_a;
    SELECT * FROM A
    Regards
    Faheem Latif

  • Error while using UTL_FILE

    I am getting the following error while using UTL_FILE procedure while using UTL_FILE.FOPEN procedure
    from system account. I am using Windows XP with NTFS.
    SQL> create or replace directory FILE_DIR as 'C:\'
    2 /
    Directory created.
    SQL> grant read on directory FILE_DIR to public;
    Grant succeeded.
    1 create or replace PROCEDURE file_upload IS
    2 v_file_name VARCHAR2(200);
    3 v_file_type UTL_FILE.FILE_TYPE;
    4 v_line VARCHAR2(1000);
    5 BEGIN
    6 v_file_name := 'customers_'||TO_CHAR(SYSDATE,'dd')||TO_CHAR(SYSDATE,'MON')||TO_CHAR(SYSDATE,'YYYY')||'.txt';
    7 v_file_type := UTL_FILE.FOPEN('FILE_DIR','V_FILE_NAME','r',1000);
    8 UTL_FILE.GET_LINE(v_file_type,V_LINE,1000);
    9 UTL_FILE.FCLOSE(v_file_type);
    10 DBMS_OUTPUT.PUT_LINE(V_LINE);
    11* END;
    SQL> exec file_upload;
    BEGIN file_upload; END;
    ERROR at line 1:
    ORA-29283: invalid file operation
    ORA-06512: at "SYS.UTL_FILE", line 475
    ORA-29283: invalid file operation
    ORA-06512: at "SYSTEM.FILE_UPLOAD", line 7
    ORA-06512: at line 1
    I appreciate if someone can help me in this regard.
    Thanks in Advance.
    Regards
    Muhammad ALi

    Hello,
    What exactly are you trying to do? Here I got 2 examples for you , replace with your directory name and pick right option for 'a' (append) or 'w' (write) or 'R' (read).
    To read from a directory_ . This will read an existing file 'customer.txt" from the directory
    {code}
    CREATE OR REPLACE PROCEDURE .file_upload
    IS
    v_file_name VARCHAR2 (200);
    v_file_type UTL_FILE.file_type;
    v_line VARCHAR2 (1000);
    BEGIN
    v_file_name := 'customers.txt';
    v_file_type := UTL_FILE.fopen ('EXT_TABLES', v_file_name, 'R');
    UTL_FILE.get_line (v_file_type, v_line); -- Error was here
    DBMS_OUTPUT.put_line (v_line);
    UTL_FILE.fclose (v_file_type);
    END;
    {code}
    _*To open a file*_ This will create customer_XXXXX file under the directory
    {code}
    CREATE OR REPLACE PROCEDURE testme.file_upload
    IS
    v_file_name VARCHAR2 (200);
    v_file_type UTL_FILE.file_type;
    v_line VARCHAR2 (1000);
    BEGIN
    v_file_name := 'customers_'
    || TO_CHAR (SYSDATE, 'dd')
    || TO_CHAR (SYSDATE, 'MON')
    || TO_CHAR (SYSDATE, 'YYYY')
    || '.txt';
    v_file_type := UTL_FILE.fopen ('EXT_TABLES', v_file_name, 'a');
    UTL_FILE.put_line (v_file_type, v_line);
    DBMS_OUTPUT.put_line (v_line);
    UTL_FILE.fclose (v_file_type);
    END;
    {code}
    Regards
    Edited by: OrionNet on Jan 29, 2009 12:30 AM

  • UTL_file Procedure- some error on invalid directory path

    Hi,
    I Created a file procedure...but while executing a procedure its showing directory Error....
    Find the solution and post it...
    Heading 2: h2. ERROR -29280ORA-29280: invalid directory path
    create or replace
    PROCEDURE HELLOFLE IS
    v_MyFileHandle UTL_FILE.FILE_TYPE;
    BEGIN
    v_MyFileHandle := UTL_FILE.FOPEN('C:\','HELLO.TXT','a');
    UTL_FILE.PUT_LINE(v_MyFileHandle,'Hello World! ' || TO_CHAR(SYSDATE,'MM-DD-YY HH:MI:SS AM'));
    UTL_FILE.FCLOSE(v_MyFileHandle);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR ' || TO_CHAR(SQLCODE) || SQLERRM);
    NULL;
    END;

    This is the spec of fopen:
    UTL_FILE.FOPEN (
       location     IN VARCHAR2,
       filename     IN VARCHAR2,
       open_mode    IN VARCHAR2,
       max_linesize IN BINARY_INTEGER)
      RETURN file_type;
    Location is not "c:\" but a directory object name. See the pl/sql manual:
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/u_file.htm

  • What is the wrong in this utl_file

    declare
         f utl_file.file_type;
         --v_str varchar2(32000);
         TYPE TAB_COL IS TABLE OF VARCHAR2(30);
         V_TAB_COL TAB_COL;
         FILE_NAME VARCHAR2(32000);
         V_LEN NUMBER;
         V_TOT_SIZE VARCHAR2(32000);
         V_TOT_SIZE1 VARCHAR2(32000);
         V_TOT_SIZE2 VARCHAR2(32000);
    SQL_STR VARCHAR2(32000);
         lv_loop_counter NUMBER;
    begin
    select COLUMN_NAME BULK COLLECT INTO V_TAB_COL FROM ALL_TAB_COLUMNS WHERE
         TABLE_NAME='CN_SMSC' AND OWNER='TEST';
         FOR I IN V_TAB_COL.FIRST..V_TAB_COL.LAST
    LOOP
              FILE_NAME:=FILE_NAME||','||V_TAB_COL(I);
    --DBMS_OUTPUT.PUT_LINE(FILE_NAME);
    /*lv_loop_counter := 1;
    WHILE (lv_loop_counter < LENGTH(FILE_NAME ))
    LOOP
    DBMS_OUTPUT.PUT_LINE(SUBSTR(FILE_NAME ,lv_loop_counter,255));
    -- DBMS_OUTPUT.PUT_LINE(FILE_NAME);
    lv_loop_counter:= lv_loop_counter + 255;
    END LOOP; */
    END LOOP;
         SELECT LENGTH(FILE_NAME) INTO V_LEN FROM DUAL;
         SELECT SUBSTR(FILE_NAME,2,V_LEN) INTO V_TOT_SIZE FROM DUAL;
         SELECT REPLACE(V_TOT_SIZE,',',',S.') INTO V_TOT_SIZE1 FROM DUAL;
         V_TOT_SIZE2:='S.'||V_TOT_SIZE1;
    SQL_STR:=' DECLARE      f utl_file.file_type; BEGIN
    f := utl_file.fopen('||'''E:\NETWORK_ELEMENT_ID_KEY'''||','||'''A.txt'''||','||'''W'''||');
    for s in (select '||V_TOT_SIZE ||' from cn_smsc)
    loop
    --V_TOT_SIZE2 holds list of column name like s.col_name1,s.col_name2
    utl_file.put_line(f, '||V_TOT_SIZE2 ||' );
    end loop;
         utl_file.fclose(f);
    END;';
    lv_loop_counter := 1;
    WHILE (lv_loop_counter < LENGTH(SQL_STR ))
    LOOP
    DBMS_OUTPUT.PUT_LINE(SUBSTR(SQL_STR ,lv_loop_counter,255));
    lv_loop_counter:= lv_loop_counter + 255;
    END LOOP;
    -- DBMS_OUTPUT.PUT_LINE(SQL_STR);
    EXECUTE IMMEDIATE SQL_STR;
    end;
    it return :
    ORA-06550: line 6, column 9:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    ORA-06550: line 6, column 9:
    PL/SQL: Statement ignored
    ORA-06512: at line 57
    n.b: i want to make it dynamic

    You call utl_file.put_line with a list of fields as separate parameters, that is obviously wrong. Consider to have a look on your generated sql (uncomment dbms_output call at the bottom of your block) and compare with utl_file package specification .
    Best regards
    Maxim

  • Utl_file not getting generated

    hi i wrote one procedure using utl_file , to check the output of the file in a text format and it was created successfully , intially it had problems with directory and i created that directory and even granted permissions using system user but nothing is happening the text file is not getting generated.
    CREATE TABLE ITEM (IT_CODE VARCHAR2(12),IT_NAME VARCHAR2(20))
    INSERT INTO ITEM VALUES ('A','AAA')
    SQL> CREATE DIRECTORY MY_DIR AS 'C:\TEMP'; -- this is the path of my local folder
    Directory created.
    SQL> GRANT READ ON DIRECTORY MY_DIR TO ORION2007;
    Grant succeeded.
    SQL> GRANT WRITE ON DIRECTORY MY_DIR TO ORION2007;
    Grant succeeded.
    CREATE OR REPLACE PROCEDURE it_status
    IS
    v_filehandle UTL_FILE.file_type;
    CURSOR itc
    IS
    SELECT *
    FROM item
    ORDER BY it_code;
    BEGIN
    v_filehandle := UTL_FILE.fopen ('MY_DIR', 'AAAA.TXT', 'w');
    --Opening a file utl_file.putf(v_filehandle,'Item file :GENERATED ON %s\n',SYSDATE);
    UTL_FILE.new_line (v_filehandle);
    FOR v_it_rec IN itc
    LOOP
    UTL_FILE.putf (v_filehandle,
    'Item Details %s are:s\n',
    v_it_rec.it_code,
    v_it_rec.it_name
    END LOOP;
    UTL_FILE.put_line (v_filehandle, '***END OF REPORT***');
    UTL_FILE.fclose (v_filehandle);
    END it_status;
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    i tried using get_line but there is a error
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE OR REPLACE PROCEDURE it_status
      2  IS
      3     v_filehandle   UTL_FILE.file_type;
      4     CURSOR itc
      5     IS
      6        SELECT   *
      7            FROM item
      8        ORDER BY it_code;
      9  v_txt varchar2(1000) := 'aaa.txt';
    10  BEGIN
    11     v_filehandle := UTL_FILE.fopen ('MY_DIR', 'AAAA.TXT', 'w');
    12     --Opening a file          utl_file.putf(v_filehandle,'Item file :GENERATED ON %s\n',SYSDATE);
    13     UTL_FILE.new_line (v_filehandle);
    14     FOR v_it_rec IN itc
    15     LOOP
    16     UTL_FILE.GET_LINE(v_filehandle,v_txt,32767);
    17     UTL_FILE.FCLOSE(v_filehandle);
    18        UTL_FILE.putf (v_filehandle,
    19                       'Item Details %s are:s\n',
    20                       v_it_rec.it_code,
    21                       v_it_rec.it_name
    22                      );
    23     END LOOP;
    24     UTL_FILE.put_line (v_filehandle, '***END OF REPORT***');
    25     UTL_FILE.fclose (v_filehandle);
    26* END it_status;
    SQL> /
    Procedure created.
    SQL> exec it_status;
    BEGIN it_status; END;
    ERROR at line 1:
    ORA-29283: invalid file operation
    ORA-06512: at "SYS.UTL_FILE", line 98
    ORA-06512: at "SYS.UTL_FILE", line 656
    ORA-06512: at "ORION2007.IT_STATUS", line 16
    ORA-06512: at line 1

  • Reading Text Files using Oracle PL/SQL and UTL_FILE

    Hi, experts. I tried to read a text file into oracle. Here is what i did:
    1. Create a text file in the directory: C:\temp\New Text Document.txt
    2. Run the following SQL in PL/SQL:
    CREATE or replace DIRECTORY sampledata AS 'C:\temp\';
    grant read, write on directory sampledata to public;
    3. When I run the following code, it caused an error: ora-29280: invalid directory path. I have alread checked the directory path, it is correct. Would someone know what wrong is my code?
    declare
    f utl_file.file_type;
    s varchar2(3000);
    begin
    f := utl_file.fopen('sampledata','New Text Document.txt','R');
    utl_file.get_line(f,s);
    utl_file.fclose(f);
    dbms_output.put_line(s);
    end;
    Thank you

    Try with a filename without spaces:No problem with spaces
    SQL> declare
      2  f utl_file.file_type;
      3  s varchar2(3000);
      4  begin
      5  f := utl_file.fopen('SAMPLEDATA','New Text Document.txt','R');
      6  utl_file.get_line(f,s);
      7  utl_file.fclose(f);
      8  dbms_output.put_line(s);
      9  end;
    10  /
    line1
    PL/SQL procedure successfully completed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error in UTL_FILE

    Hi,
    I am working in oracle9i . I am using UTL_FILE to read and write a file in oracle.
    If i use the procedure means.
    SQL> CREATE OR REPLACE PROCEDURE test_utl IS
    2 id UTL_FILE.FILE_TYPE;
    3 BEGIN
    4 id := UTL_FILE.FOPEN('/oracle/data',
    5 'test.txt',
    6 'W');
    7 UTL_FILE.FCLOSE(id);
    8 END test_utl;
    9 /
    Warning: Procedure created with compilation errors
    its showing error as.
    SQL> show errors;
    Errors for PROCEDURE GETR_ERECS.TEST_UTL:
    LINE/COL ERROR
    2/6 PLS-00201: identifier 'UTL_FILE' must be declared
    2/6 PL/SQL: Item ignored
    4/3 PLS-00320: the declaration of the type of this expression is incomplete or malformed
    4/3 PL/SQL: Statement ignored
    7/19 PLS-00320: the declaration of the type of this expression is incomplete or malformed
    7/3 PL/SQL: Statement ignored
    SQL>
    Kindly provide me the solutions
    rgds,

    In addition,
    You need to have DIRECT access to utl_file, not via a role.
    Normally, UTL_FILE is granted to public. Your DBA must have revoked it. You need to ask them to grant it to you.

Maybe you are looking for

  • Quicktime 7.5.5 SANYO Xacti MP4 movie file Audio Sync Bug..

    Hello. I am awkward in English. NEW Ver. Quicktime 7.5.5 SANYO Xacti MPEG-4 movie file.. Audio Codec AAC, Sound Sync Bug audio and video files they are not in sync. KMPlayer MPEG-4 movie file Problem without Play.. Quicktime MPEG-4 Sound Sync Bug, Wa

  • Hierarchal Report for Fund Centre Hierarchy/Group for Total Records

    Hello Gurus, I need to check if there is some Hierarchal report in FM which displays the data as per my Funds Centre Hierarchy or group. Like there is a report in Cost Centre Accounting (S_ALR_87013611) which displays the figures according to differe

  • How to Propram

    I devlop a software using Developer 2000, during entry i need sum of the existing and newly enterd values, i made it to first save in a table, but meanwhile operator makes an error and whishes to re-correct the entry that has been alredy saved, what

  • Reshipping the log files to logical standby

    Hi All I am getting this error in the logical standby "ORA-01291: missing logfile" . The problem I had some wrong configuration in "standby_archive_dest" parameter in the logical database but I fixed it and now I need to reship the logfiles from prim

  • 2 Arch boxes, 1 Home

    Hi All I have 2 partitions each with arch installed, one for general stuff & one for development & testing, but each uses the same home partition.  Is there a way that i can use different settings in .xinitrc based on which version of arch i am booti