# transaction read write  commit updates
# commitあるいはrollbackの動作確認をする。
# 各々のスクリプトごとに各種の論理ファイルを試す。
Begin;
Initialize;
InitializeSession "DefaultDB";

Command  "create table T1(C1 ntext array [no limit])";
# 一度のtransactionで複数のタプルを操作する
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# update->commitの動作確認
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# delete->commitの動作確認
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit] hint heap)";
# 一度のtransactionで複数のタプルを操作する
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# update->commitの動作確認
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# delete->commitの動作確認
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit])";
Command  "create fulltext index I1_1 on T1(C1)";
# 一度のtransactionで複数のタプルを操作する
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# update->commitの動作確認
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# delete->commitの動作確認
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit] hint heap)";
Command  "create fulltext index I1_1 on T1(C1)";
# 一度のtransactionで複数のタプルを操作する
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# update->commitの動作確認
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# delete->commitの動作確認
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit])";
Command  "create fulltext index I1_1 on T1(C1) hint 'sectionized'";
# 一度のtransactionで複数のタプルを操作する
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# update->commitの動作確認
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# delete->commitの動作確認
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit] hint heap)";
Command  "create fulltext index I1_1 on T1(C1) hint 'sectionized'";
# 一度のtransactionで複数のタプルを操作する
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# update->commitの動作確認
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# delete->commitの動作確認
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit])";
Command  "create fulltext index I1_1 on T1(C1) hint 'delayed'";
# 一度のtransactionで複数のタプルを操作する
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# update->commitの動作確認
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# delete->commitの動作確認
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit] hint heap)";
Command  "create fulltext index I1_1 on T1(C1) hint 'delayed'";
# 一度のtransactionで複数のタプルを操作する
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# update->commitの動作確認
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# delete->commitの動作確認
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit])";
Command  "create fulltext index I1_1 on T1(C1) hint 'inverted=(normalized=true)'";
# 一度のtransactionで複数のタプルを操作する
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# update->commitの動作確認
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# delete->commitの動作確認
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit] hint heap)";
Command  "create fulltext index I1_1 on T1(C1) hint 'inverted=(normalized=true)'";
# 一度のtransactionで複数のタプルを操作する
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# update->commitの動作確認
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

# delete->commitの動作確認
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "commit";
Command  "select * from T1";

Command  "drop table T1";

TerminateSession "DefaultDB";
Terminate;
End;
