SQL*PLus script for running external scripts
From: Álvaro G. Vicario <alvaro.NOSPAMTHANX_at_demogracia.com>
Date: Mon, 09 Feb 2009 14:09:01 +0100
Message-ID: <gmp9tg$7jm$1_at_nntp.motzarella.org>
I have a collection of text files where I've been writing down the code to create and populate my app's database objects. A typical file looks like this:
Date: Mon, 09 Feb 2009 14:09:01 +0100
Message-ID: <gmp9tg$7jm$1_at_nntp.motzarella.org>
I have a collection of text files where I've been writing down the code to create and populate my app's database objects. A typical file looks like this:
/*
- Test table - test.sql */ CREATE TABLE TEST ( TEST_ID NUMBER NOT NULL ENABLE, NAME VARCHAR2(50),
COMMENT ON TABLE TEST IS 'Test table';
- Name is unique ALTER TABLE TEST ADD CONSTRAINT TEST_UK1 UNIQUE (NAME) ENABLE;
Apparently, I need to use the _at_@ operator [1]. It does indeed run the external files, but I get a syntax error on every line: it seems to be expecting single-line commands. The manual mentions the need to run "SET SQLTERMINATOR" [2] but I can't figure out how.
I'd appreciate some help to get started. I'm running these tests in a local installation of Oracle Database 10g Express Edition Release 10.2.0.1.0.
[1]
http://download-west.oracle.com/docs/cd/B12037_01/server.101/b12170/ch13.htm#i2696759
[2]
http://download-west.oracle.com/docs/cd/B12037_01/server.101/b12170/ch13.htm#i2498515
--
- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
- Mi sitio sobre programación web: http://bits.demogracia.com
- Mi web de humor al baño María: http://www.demogracia.com --