# update[1]/fulltext(sectionized)
Begin;
Initialize;
# テスト用のDBを作る
InitializeSession "";
Command "create database TESTDB";
TerminateSession;

InitializeSession "TESTDB";
Command  "create table T1(C1 ntext array [no limit])";
Command  "create fulltext index I1_1 on T1(C1) hint 'sectionized'";
Command  "select C1 from T1";
# SQLコマンドupdateをテストする
# update対象のタプルをまずinsert
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt", textsjisfile "..\\..\\doc\\ricoh.txt"]];
# 自分自身にupdate
Command  "update T1 set C1=?" [[textsjisfile "..\\..\\doc\\hello.txt", textsjisfile "..\\..\\doc\\ricoh.txt"]];
# 別の内容にupdate
Command  "update T1 set C1=?" [[textsjisfile "..\\..\\doc\\ricoh.txt", textsjisfile "..\\..\\doc\\hello.txt"]];
# updateされない(はずの)タプルをinsert
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\Teihon.txt", textsjisfile "..\\..\\doc\\hello.txt"]];
# 存在しないタプルをwhere句で指定
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\ricoh.txt", textsjisfile "..\\..\\doc\\hello.txt"], [textsjisfile "..\\..\\doc\\hello.txt", textsjisfile "..\\..\\doc\\ricoh.txt"]];
# 存在するタプルをwhere句で指定。片方のみ更新される
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\hello.txt", textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt", textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "select C1 from T1";
Command  "drop table T1";

TerminateSession;
# DBの後始末
InitializeSession "";
Command "drop database TESTDB";
TerminateSession;
Terminate;
End;
