1 /**********************************************************
3 * create table t1 with int
4 * create index if specified
5 * check table information for tuple size
9 #include <DatabaseManagerImpl.h>
13 DbRetVal rv
= conn
.open("root", "manager");
14 if (rv
!= OK
) return 1;
15 DatabaseManagerImpl
*dbMgr
= (DatabaseManagerImpl
*) conn
.getDatabaseManager();
16 if (dbMgr
== NULL
) { printf("Auth failed\n"); return 2;}
20 tabDef
.addField("f1", typeInt
, 0, NULL
, true);
21 tabDef
.addField("f2", typeString
, 1);
22 tabDef
.addField("f3", typeInt
);
23 rv
= dbMgr
->createTable("t1", tabDef
);
24 if (rv
!= OK
) { printf("Table creation failed\n"); return rv
; }
25 printf("Table created\n");
27 if (rv
!= OK
) ret
= 5;
28 TableImpl
*table
= (TableImpl
*) dbMgr
->openTable("t1");
30 dbMgr
->closeTable((Table
*)table
);
31 dbMgr
->dropTable("t1");