0

I've always developed shell scripts on server Unix where the script before runs the SQL-Loader for loading the file to be inserted into an Oracle table and after verifies if it's been generated any BAD file and in that case for example it sends an email to me with a warning.

Instead, by using an external table, I've got the main advantage not to handle any shell scripts but since only at the moment I run the SELECT from my external table a BAD file might be generated on the server, how can I have an automated check on its existence and to handle it from Oracle?

Oracle version 10g

Thanks!

Littlefoot
  • 131,892
  • 15
  • 35
  • 57
Mark
  • 9
  • 5

1 Answers1

0

With external tables, everything you do, you do in Oracle (i.e. within the database).

Therefore, you could

  • create a PL/SQL program (anonymous PL/SQL block or a stored procedure)
  • access the external table
  • do whatever you do
  • after it is finished, use UTL_FILE to check log/bad file
  • use DBMS_MAIL to send an e-mail if there's something "wrong"
Littlefoot
  • 131,892
  • 15
  • 35
  • 57