Guest User

Untitled

a guest
Jun 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. column dt new_value _dt
  2. select to_char(sysdate,'yyyymmdd_hh24mi') dt from dual;
  3. set line 10000;
  4. set pagesize 50000;
  5. set serveroutput on;
  6.  
  7. spool .backupTEST_TABLE.sql
  8.  
  9. select dbms_metadata.get_ddl(object_type, object_name)
  10. from user_objects
  11. where object_type in ('FUNCTION')
  12. and object_name = 'TEST_TABLE';
  13.  
  14. Spool Off
  15.  
  16. spool .!Run_&_dt..txt
  17.  
  18. BEGIN
  19. raise_application_error( -20001, 'This is a custom error' );
  20. EXCEPTION
  21. WHEN OTHERS THEN
  22. Prompt ./backup/backup.sql
  23. @ ./backup/backup.sql
  24. END;
  25.  
  26. Spool Off
  27.  
  28. >> BEGIN
  29. raise_application_error( -20001, 'This is a custom error' );
  30. EXCEPTION
  31. WHEN OTHERS THEN
  32. Prompt ./backup/backup.sql
  33. @ ./backup/backup.sql
  34. END;
  35.  
  36.  
  37. Spool Off
  38. Error at line 18
  39. ORA-06550: line 6, column 11:
  40. PLS-00103: Encountered the symbol "/" when expecting one of the following:
  41.  
  42. <an identifier> <a double-quoted delimited-identifier>
  43. current delete exists prior
  44. ORA-06550: line 6, column 49:
  45. PLS-00103: Encountered the symbol "SQL" when expecting one of the following:
  46.  
  47. <an identifier> <a double-quoted delimited-identifier>
  48. current delete exists prior
Add Comment
Please, Sign In to add comment