Re: SQLPLUS script
Date: Wed, 10 Aug 1994 19:33:50 GMT
Message-ID: <sjsCuC3oE.57v_at_netcom.com>
This method below is known as a HERE document. You can read more about HERE documents in a variety of UNIX shell script books on the market. We use HERE documents ALL THE TIME. I almost NEVER use straight .sql files that get START'ed by sqlplus. I rather write shell scripts with HERE documents containing SQL code(DDL and DML).
You can go all sorts of cool code generation things this way too.
Good luck.
: If you're running it in Unix, you can always write a shell script with
: input redirection such as:
: .
: . (Unix script, if any)
: .
: sqlplus -s / <<EOF
: .
: . (your sql script here)
: .
: exit
: EOF
: .
: . (Unix script, if any)
: .
: Note: the line "sqlplus ...." can have other stuff such as redirect error, etc.
: Don't put any blank line within your sql script lines. ORACLE will
: interpret that as a break in the input mode and stops (just like when
: you type in your script in SQLPLUS).
: The shell will stops your input line when it encounter EOF. You can
: change this to any character combination you want. Just make sure
: you change it at both spots.
: Have fun.
: -----------------------------
: Kim Ng
: (Just a low life contract programmer. Thus, my clients won't adopt my views.)
-- ------------------------------------------------------------------ Steve Schow | But you don't need to use the claw, if you sjs_at_netcom.com | pick the pear with the big paw paw...... (415) 354-4908 | Have I given you a clue......? 800-722-2007x4908 | - Baloo the Bear ------------------------------------------------------------------Received on Wed Aug 10 1994 - 21:33:50 CEST