How do I create a table which
has multiple attributes as a primary key?
The table definition looks something like this.
create table
TableName(
attribute1 TYPE,
attribute2 TYPE,
...
PRIMARY
KEY(attribute1, attribute2)
);
How to execute multiple SQL
statement as a batch?
First, you need to prepare a .txt file (we
suppose it's named as C:/sql.txt) which contains all of the SQL statement you
want to execute.
The file looks like:
create table test(a varchar(10), b char(2));
insert into test(a,b) values('hello','01');
insert into test(a,b) values('world','02');
commit;
Then, at the SqlPlus prompt, just type:
SQL>@c:/sql.txt;