Guest User

Untitled

a guest
Jan 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. create or replace
  2. PROCEDURE PrintFile(p_fName VARCHAR2) as
  3. f utl_file.file_type;
  4. pga int;
  5. BEGIN
  6. pga := execute immediate 'select sum(value) from v$pgastat;';
  7. f := utl_file.fopen('INPUT', p_fName, 'w');
  8. UTL_FILE.PUT_LINE(f,TO_CHAR(SYSDATE,'MM-DD-YY HH:MI:SS AM')||pga);
  9. UTL_FILE.FCLOSE(f);
  10. EXCEPTION
  11. WHEN NO_DATA_FOUND THEN UTL_FILE.FCLOSE(f);
  12. END;
Add Comment
Please, Sign In to add comment