Open Game Engine 2D API
 All Functions Variables
Functions
Database

Functions

int OGE_SaveDataToDB (int iDataId, int iSessionId)
 Save data into the database.
int OGE_LoadDataFromDB (int iDataId, int iSessionId)
 Load the data from the database.
bool OGE_IsValidDBType (int iDbType)
 Check if the input type is a valid database type.
int OGE_OpenDefaultDB ()
 Open the default database.
int OGE_OpenDB (int iDbType, string sCnnStr)
 Open a database.
void OGE_CloseDB (int iSessionId)
 Close the database.
int OGE_RunSql (int iSessionId, string sSql)
 Execute an SQL statement.
int OGE_OpenQuery (int iSessionId, string sQuerySql)
 Execute a query.
void OGE_CloseQuery (int iQueryId)
 Close a query.
int OGE_FirstRecord (int iQueryId)
 Move the cursor to the first record of the query.
int OGE_NextRecord (int iQueryId)
 Move the cursor to the next record.
bool OGE_GetBoolFieldValue (int iQueryId, string sFieldName)
 Get the boolean value of a field in current record.
int OGE_GetIntFieldValue (int iQueryId, string sFieldName)
 Get the integer value of a field in current record.
double OGE_GetFloatFieldValue (int iQueryId, string sFieldName)
 Get the floating-point value of a field in current record.
string OGE_GetStrFieldValue (int iQueryId, string sFieldName)
 Get the string value of a field in current record.
string OGE_GetTimeFieldValue (int iQueryId, string sFieldName)
 Get the datetime value of a field in current record.

Function Documentation

void OGE_CloseDB ( int  iSessionId)

Close the database.

Parameters:
[in]iSessionIdThe session ID of the database
void OGE_CloseQuery ( int  iQueryId)

Close a query.

Parameters:
[in]iQueryIdThe ID of the query
int OGE_FirstRecord ( int  iQueryId)

Move the cursor to the first record of the query.

Parameters:
[in]iQueryIdThe ID of the query
Returns:
Current position of the cursor
bool OGE_GetBoolFieldValue ( int  iQueryId,
string  sFieldName 
)

Get the boolean value of a field in current record.

Parameters:
[in]iQueryIdThe ID of the query
[in]sFieldNameThe name of the field
Returns:
The boolean value of the field
double OGE_GetFloatFieldValue ( int  iQueryId,
string  sFieldName 
)

Get the floating-point value of a field in current record.

Parameters:
[in]iQueryIdThe ID of the Query
[in]sFieldNameThe name of the field
Returns:
The floating-point value of the field
int OGE_GetIntFieldValue ( int  iQueryId,
string  sFieldName 
)

Get the integer value of a field in current record.

Parameters:
[in]iQueryIdThe ID of the query
[in]sFieldNameThe name of the field
Returns:
The integer value of the field
string OGE_GetStrFieldValue ( int  iQueryId,
string  sFieldName 
)

Get the string value of a field in current record.

Parameters:
[in]iQueryIdThe ID of the query
[in]sFieldNameThe name of the field
Returns:
The string value of the field
string OGE_GetTimeFieldValue ( int  iQueryId,
string  sFieldName 
)

Get the datetime value of a field in current record.

Parameters:
[in]iQueryIdThe ID of the query
[in]sFieldNameThe name of the field
Returns:
The string value of the datetime field
bool OGE_IsValidDBType ( int  iDbType)

Check if the input type is a valid database type.

Parameters:
[in]iDbTypeThe database type
Returns:
Valid or not
int OGE_LoadDataFromDB ( int  iDataId,
int  iSessionId 
)

Load the data from the database.

Parameters:
[in]iDataIdThe ID of the data
[in]iSessionIdThe session ID of the database
Returns:
Return a non-negative number if succeed
int OGE_NextRecord ( int  iQueryId)

Move the cursor to the next record.

Parameters:
[in]iQueryIdThe ID of the query
Returns:
Current position of the cursor
int OGE_OpenDB ( int  iDbType,
string  sCnnStr 
)

Open a database.

Parameters:
[in]iDbTypeThe type of the database
[in]sCnnStrThe connection string
Returns:
The session ID of the database

Open the default database.

Returns:
The session ID of the default database
int OGE_OpenQuery ( int  iSessionId,
string  sQuerySql 
)

Execute a query.

Parameters:
[in]iSessionIdThe session ID of the database
[in]sQuerySqlThe SQL statement of the query
Returns:
The ID of the query
int OGE_RunSql ( int  iSessionId,
string  sSql 
)

Execute an SQL statement.

Parameters:
[in]iSessionIdThe session ID of the database
[in]sSqlThe SQL statement
Returns:
Return a non-negative number if succeed
int OGE_SaveDataToDB ( int  iDataId,
int  iSessionId 
)

Save data into the database.

Parameters:
[in]iDataIdThe ID of the data
[in]iSessionIdThe session ID of the database
Returns:
Return a non-negative number if succeed