I'm the same guy that asked:
BEGIN/END and CREATE Table in single .sql file
Anyhow, we have a several .sql scripts we're executing via SQL*Plus.
These scripts are used for creating tables, synonyms, indexes, views etc.
A single .sql file will usually have several CREATE statements inside them.
What we're looking for is a way to report pass/fail for each CREATE statement, as well as an error message if it failed.
Create table foo: Pass
Create index bar: Fail - Reason...
Create synonym foo_1: Pass etc.
Currently, we can parse the SQL*Plus output, however, this has a lot of extraneous stuff in it, and parsing a logfile like this isn't the most robust approach.
Is there a better way to programmatically check on the return status of each SQL statement via SQLPlus, and the error message, if any? Is that something achievable with SQLPlus?
Or do I need to write a wrapper of some sort (Bash, Python etc.)? Or handle this all via another way?
Cheers, Victor