Script Handling
A batch of DDL and/or DML statements in a text file is known as a script.Scripts can be used to create and alter database objects.These are referred to as Data Definition Language (DDL) scripts.Scripts that manipulate data by selecting, inserting, updating, deleting or performing data conversions, are called Data Manipulation Language (DML) scripts.
One of the most important tasks handled by isql
is to process scripts.It can handle both DDL and DML Scripts, but they should be included in separate scripts to avoid data integrity problems.This script processing feature of isql
allows the linking of one script to another using the isql
command INPUT <filespec>
.Scripts statements are executed in order that they appear in the script file.The default setting in isql
for AUTODDL
is set to ON
.You may use the [isql-set-autoddl] command to control where or when DDL statements will be committed.
Note
|
The SQL> set autoddl on; SQL> insert into test(a) values (666); SQL> commit; SQL> select * from test; A ============ 666 SQL> insert into test(a) values (999); SQL> select * from test; A ============ 666 999 SQL> create table another_test(b integer); SQL> rollback; SQL> select * from test; A ============ 666 |
Scripts can redirect their output to a log file using the OUTPUT file_name
command.This can be entered directly at the isql
prompt, or as part of a script file itself.