假设:
A.数据库servername: testserver
B.数据库名:testdb
C.SQL脚本文件:
sqlfile.sql
create table test_table(c1 integer);
insert into test_table(c1) values(12);
update test_table set c1=0;
delete test_table where 1=1;
drop table test_table;
sqlfile2.sql
create table test_table(c1 integer);
insert into test_table(c2) values(12);
insert into test_table(c1) values(12);
update test_table set c1=0;
delete test_table where 1=1;
drop table test_table;
一.执行SQL脚本文件方式
1.调用dbaccess执行SQL脚本文件
A.简单执行SQL文件
dbaccess testdb sqlfile.sql 或者 dbaccess testdb@testserver sqlfile.sql
Database selected.
Table created.
1 row(s) inserted.
1 row(s) updated.
1 row(s) deleted.
Table dropped.
Database closed.
B.执行输出打印执行语句及执行结果
dbaccess -e testdb sqlfile.sql
crea