Begin;
Initialize;
InitializeSession "";
Command "create database TESTDB";
TerminateSession;

InitializeSession "TESTDB";

######################################################################

#Command "drop table T";
Command "create table T(f int, g int generated by default as identity (get max), h int)";

#明示的なトランザクション中に g の値を指定して数件の挿入を数回繰り返し、ロールバックする

Command "start transaction read write";
Command "insert T values (1, 100, 10), (2, 200, 20), (3, 300, 30)";
Command "insert T values (4, 400, 40), (5, 500, 50), (6, 600, 60)";
Command "rollback";

Command "start transaction read write";
Command "insert T values (1, 100, 10), (2, 200, 20), (3, 300, 30)";
Command "insert T values (4, 400, 40), (5, 500, 50), (6, 600, 60)";
Command "commit";

#Terminateせずにスクリプトを終了する

######################################################################

TerminateSession;
End;
