Skip to content

Instantly share code, notes, and snippets.

@finsterthecat
finsterthecat / sql-batch.sql
Created November 17, 2010 15:53
Driver script to run a series of scripts (sql, sqlldr or otherwise) within oracle sqlplus
-- cross platform! Works on unix and windows. Notice ability to run host programs?!
accept _usr prompt 'UserName: (app) ' default 'app'
accept _pwd prompt 'Password: (&_usr) ' default &_usr hide
accept _tns prompt 'TNSalias: (SUE2DEV) ' default 'SUE2DEV'
whenever sqlerror exit
connect &_usr/&_pwd@&_tns
whenever sqlerror continue