Read text file to insert data into Oracle SQL table

前端 未结 6 2065
慢半拍i
慢半拍i 2020-12-30 16:35

I am studying Oracle SQL developer.

What I am doing is reading text file line by line from the folder. Then Inserting data to the SQL table.

I am able to com

6条回答
  •  死守一世寂寞
    2020-12-30 17:28

    You can't able to enter the path directly to the file open command like this

    f := UTL_FILE.FOPEN('C:\Projects\','testdatabinary.txt','R');
    

    Instead of entering path directly, you have to create directory using the below sql query

    CREATE or replace DIRECTORY USER_DIR AS 'C:\PROJECTS\';

    Then enter the directory name to the file open command. It will be like this

    f := UTL_FILE.FOPEN('USER_DIR ','testdatabinary.txt','R');
    

提交回复
热议问题