DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: 9i external tables - reading file from the network

  1. #1
    Join Date
    Dec 2002
    Posts
    110

    9i external tables - reading file from the network

    Hi


    We are using 9i external tables for reading data from the files.
    The files are on the same machine on which the oracle9i database server is installed.


    The files are actually uploaded & reside originally on a different machine where our app server is installed.

    Currently we copy all the files into teh machine where orcle 9i databse server is installed & then use external tables to read the same.

    What i would like to know is that is it possible to read files for external tables over the network

    If yes can some one give an example


    Rgrds

  2. #2
    Join Date
    Dec 2002
    Posts
    110

    os is win2k

    forgot to add i am using win2k OS

  3. #3
    Join Date
    Aug 2002
    Location
    Atlanta
    Posts
    1,187
    same user/pass on same domain from the app serv?

    Use the UNC name in the cr8 dir and utl_file like the below example......

    CREATE DIRECTORY test_dir AS '\\myserver\look_for_files_here';

    CREATE OR REPLACE PROCEDURE test
    AS
    v_output_file1 utl_file.file_type;
    BEGIN
    /* Ensure TEST_DIR below is in all caps */
    /* Third argument below is W which overwrites file each time, change to A to append */
    v_output_file1 := utl_file.fopen('TEST_DIR', 'my_test.csv', 'W');
    FOR cursor_emp IN (SELECT empnom,ename, deptno FROM emp)
    LOOP
    utl_file.put_line(v_output_file1, cursor_emp.empno || ',' || cursor_emp.ename || ',' || cursor_emp.deptno);
    END LOOP;
    utl_file.fclose_all;
    END;
    /
    I'm stmontgo and I approve of this message

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width