#systemDBの中身を覗く(2)

Begin;
Initialize;
InitializeSession "";

Command "select * from System_Table";
Command "select * from System_Column";
Command "select * from System_Constraint";
Command "select * from System_Index";
Command "select * from System_Key";
Command "select * from System_File";
Command "select * from System_Field";
Command "select * from System_Area";
Command "select * from System_AreaContent";

Command "create table T (f1 int, f2 nchar(100), f3 ntext array [no limit], primary key (f2))";
Command "create index T_f1 on T(f1)";
Command "create fulltext index T_FTS on T(f3) hint 'delayed sectionized'";
Command "create area area1 'd:\\dm\\area\\1'";
Command "create area area2 array ['d:\\dm\\area\\2a', 'd:\\dm\\area\\2b']";
Command "alter table T set area area1";
Command "insert into T values (1, ?, ?)" ["hoge", ["hoge", "hoge", "hoge"]];

Command "select * from System_Table";
Command "select * from System_Table where name = 'T'";
Command "select * from System_Column";
Command "select * from System_Column where exists (select * from system_table where name = 'T' and rowid = system_column.parentid)";
Command "select * from System_Constraint";
Command "select * from System_Constraint where exists (select * from system_table where name = 'T' and rowid = system_constraint.parentid)";
Command "select * from System_Index";
Command "select * from System_Index where name = 'T_f1'";
Command "select * from System_Index where exists (select * from system_table where name = 'T' and rowid = system_index.parentid)";
Command "select * from System_Key";
Command "select * from System_Key where exists (select * from system_index where name = 'T_f1' and rowid = system_key.parentid)";
Command "select * from System_File";
Command "select * from System_File where exists (select * from system_table where name = 'T' and rowid = system_file.parentid)";
Command "select * from System_File where exists (select * from system_index where name = 'T_f1' and fileid = system_file.rowid)";
Command "select * from System_Field";
Command "select * from System_Field where exists (select * from system_table, system_file where system_table.name = 'T' and system_table.rowid = system_file.parentid and system_file.rowid = system_field.parentid)";
Command "select * from System_Field where exists (select * from system_index, system_file where system_index.name = 'T_f1' and system_index.fileid = system_file.rowid and system_file.rowid = system_field.parentid)";
Command "select * from System_Area";
Command "select * from System_Area where name = 'area1'";
Command "select * from System_AreaContent";
Command "select * from System_AreaContent where exists (select * from system_area where name = 'area1' and rowid = system_areacontent.areaid)";
Command "select * from System_AreaContent where exists (select * from system_table where name = 'T' and rowid = system_areacontent.objectid)";
Command "select RowID, AreaID, ObjectID from system_Areacontent where system_areacontent.areaid=33";

Command "drop table T";
Command "drop area area1";
Command "drop area area2";

Command "select * from System_Table";
Command "select * from System_Table where name = 'T'";
Command "select * from System_Column";
Command "select * from System_Column where exists (select * from system_table where name = 'T' and rowid = system_column.parentid)";
Command "select * from System_Constraint";
Command "select * from System_Constraint where exists (select * from system_table where name = 'T' and rowid = system_constraint.parentid)";
Command "select * from System_Index";
Command "select * from System_Index where name = 'T_f1'";
Command "select * from System_Index where exists (select * from system_table where name = 'T' and rowid = system_index.parentid)";
Command "select * from System_Key";
Command "select * from System_Key where exists (select * from system_index where name = 'T_f1' and rowid = system_key.parentid)";
Command "select * from System_File";
Command "select * from System_File where exists (select * from system_table where name = 'T' and rowid = system_file.parentid)";
Command "select * from System_File where exists (select * from system_index where name = 'T_f1' and fileid = system_file.rowid)";
Command "select * from System_Field";
Command "select * from System_Field where exists (select * from system_table, system_file where system_table.name = 'T' and system_table.rowid = system_file.parentid and system_file.rowid = system_field.parentid)";
Command "select * from System_Field where exists (select * from system_index, system_file where system_index.name = 'T_f1' and system_index.fileid = system_file.rowid and system_file.rowid = system_field.parentid)";
Command "select * from System_Area";
Command "select * from System_Area where name = 'area1'";
Command "select * from System_AreaContent";
Command "select * from System_AreaContent where exists (select * from system_area where name = 'area1' and rowid = system_areacontent.areaid)";
Command "select * from System_AreaContent where exists (select * from system_table where name = 'T' and rowid = system_areacontent.objectid)";
Command "select RowID, AreaID, ObjectID from system_Areacontent where system_areacontent.areaid=33";

TerminateSession;
Terminate;
End;

