Advertisement
Guest User

Untitled

a guest
Jul 31st, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. set serveroutput on;
  2. CREATE or replace DIRECTORY USER_DIR AS '/home/barracuda';
  3. GRANT READ ON DIRECTORY USER_DIR TO PUBLIC;
  4.  
  5. DECLARE
  6. V1 VARCHAR2(200); --32767
  7. F1 UTL_FILE.FILE_TYPE;
  8. BEGIN
  9. F1 := UTL_FILE.FOPEN('USER_DIR','TRAVEL_07222015.dat','R');
  10. Loop
  11. BEGIN
  12. UTL_FILE.GET_LINE(F1,V1);
  13. dbms_output.put_line(V1);
  14. EXCEPTION WHEN No_Data_Found THEN EXIT; END;
  15. end loop;
  16.  
  17. IF UTL_FILE.IS_OPEN(F1) THEN
  18. dbms_output.put_line('File is Open');
  19. end if;
  20.  
  21. UTL_FILE.FCLOSE(F1);
  22. END;
  23. /
  24. set serveroutput off;
  25.  
  26. -----------------------------
  27.  
  28. Error starting at line : 5 in command -
  29. DECLARE
  30. Error report -
  31. ORA-06550: line 1, column 7:
  32. PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
  33.  
  34. begin function package pragma procedure subtype type use
  35. <an identifier> <a double-quoted delimited-identifier> form
  36. current cursor
  37. 06550. 00000 - "line %s, column %s:\n%s"
  38. *Cause: Usually a PL/SQL compilation error.
  39. *Action:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement