public static Table NewLookupTable(Database database, QNameManager.QName tableName, int tableType, QNameManager.QName colName, SqlType colType) { Table table; ColumnSchema column = new ColumnSchema(colName, colType, false, true, null); TableDerived derived1 = new TableDerived(database, tableName, tableType); derived1.AddColumn(column); TableDerived derived2 = table = derived1; QNameManager.QName indexName = derived2.GetName(); int[] columns = new int[1]; table.CreatePrimaryKeyConstraint(indexName, columns, true); return(derived2); }
public static Table NewLookupTable(Database database) { Table table; QNameManager.QName subqueryTableName = database.NameManager.GetSubqueryTableName(); ColumnSchema column = new ColumnSchema(QNameManager.GetAutoColumnName(0), SqlType.SqlInteger, false, true, null); TableDerived derived1 = new TableDerived(database, subqueryTableName, 2, null, null); derived1.AddColumn(column); TableDerived derived2 = table = derived1; QNameManager.QName name = derived2.GetName(); int[] columns = new int[1]; table.CreatePrimaryKeyConstraint(name, columns, true); return(derived2); }