home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Revista CD Expert 51
/
PCGamer51_17Demos.iso
/
games
/
CM
/
CyclingManagerDemoCangas.exe
/
CyclingManagerDemo
/
Database
/
TestDatabase.cnd
< prev
Wrap
Text File
|
2000-11-23
|
2KB
|
67 lines
func void TestDatabase()
{
DatabaseManager_SetNumQuery(8);
DatabaseManager_SetNumJoins(8);
// create subset
DatabaseSubset_Create( 1, 0);
Database_AddTables( 1, 2);
Table_SetName( 1, 0, "DYN_cyclist");
TableSubset_SelectColumns( 1, 0, "*");
Table_SetName( 1, 1, "DYN_team");
TableSubset_SelectColumns( 1, 1, "*");
// create query
Query_Create(0, 1);
Query_SetNumJoinTables( 0, 2);
Query_SelectJoinTable( 0, 0, "DYN_cyclist");
Query_SelectJoinTable( 0, 1, "DYN_cyclist.fkIDteam.DYN_team");
Query_SelectWhereStringEqual(0, "DYN_cyclist.fkIDteam.DYN_team.Name", "BANESTO");
Query_Execute(0);
// read query
Join_Create(0,1,"DYN_cyclist.Last_name");
Join_Create(1,1,"DYN_cyclist.fkIDteam.DYN_team.Name");
//Join_Create(2,0,"DYN_cyclist.fkIDteam.DYN_team.strIDgeneral_informations.STA_localized_string.Localized");
//Join_Create(3,0,"DYN_cyclist.RO");
var i32x i;
var f32x fFloat;
var i32x iInt;
var szx szString;
i=0;
while (i<Join_GetNumRows(0))
{
szString = Join_GetStringFromIndex(0,i);
print(szString);
print("\t");
szString = Join_GetStringFromIndex(1,i);
print(szString);
print("\n");
/*
szString = Join_GetStringFromIndex(2,i);
print(szString);
print("\n");
iInt = Join_GetIntFromIndex(3,i);
print(itoa(iInt));
print("\n");
*/
i=i+1;
}
/*
Join_Create(0,0,"STA_monnaie.Conversion_factor");
i=0;
while (i<Join_GetNumRows(0))
{
fFloat = Join_GetFloatFromIndex(0,i);
print(ftoa(fFloat));
print("\n");
i=i+1;
}
*/
}