PL-SQL code to read a file
•By Amol Jadhav
PL-SQL code to read a file
Oracle apps ebs plsql to read a file
how to read a file using plsql
SQL Querysql
1DECLARE
2 fHandler UTL_FILE.FILE_TYPE;
3
4 buf VARCHAR2 (4000);
5BEGIN
6 fHandler := UTL_FILE.FOPEN ('STUDENT_DIR', 'Details.txt', 'r');
7
8 UTL_FILE.GET_LINE (fHandler, buf);
9
10 DBMS_OUTPUT.put_line ('DATA FROM FILE: ' || buf);
11
12 UTL_FILE.FCLOSE (fHandler);
13EXCEPTION
14 WHEN UTL_FILE.invalid_path
15 THEN
16 raise_application_error (
17 -20000,
18 'Invalid path. Create directory or set UTL_FILE_DIR.');
19END;
20/Related posts:
- View java class source in oracle database
- Load Java source code in oracle database
- Query to find and remove Oracle database locks
- PL-SQL code to write a file
- Query to find second and third highest value
- PL-SQL Procedure to send email with attachment
- Query to get the details of the lock in the database
- Query to find Table size