You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, how to add new columns to the table after it's already been created by the first one?
table already created
if(!SQL::ExistsTable(SQL_PLAYERS_TABLE))
{
//If not, then create a table called 'players'.
new handle = SQL::Open(SQL::CREATE, SQL_PLAYERS_TABLE); //Opening a valid handle to create a table called 'players'
SQL::AddTableColumn(handle, "p_id", SQL_TYPE_INT, 11, true); //Setting auto-increment for this field.
SQL::AddTableColumn(handle, "p_name", SQL_TYPE_VCHAR, 24);
SQL::AddTableColumn(handle, "p_password", SQL_TYPE_VCHAR, 64);
SQL::AddTableColumn(handle, "p_score", SQL_TYPE_INT);
SQL::AddTableColumn(handle, "p_posx", SQL_TYPE_FLOAT);
SQL::AddTableColumn(handle, "p_posy", SQL_TYPE_FLOAT);
SQL::AddTableColumn(handle, "p_posz", SQL_TYPE_FLOAT);
SQL::Close(handle);//Closing the previous opened handle.
}
new field that needs to be added
SQL::AddTableColumn(handle, "health", SQL_TYPE_FLOAT);
The text was updated successfully, but these errors were encountered:
Hello, how to add new columns to the table after it's already been created by the first one?
table already created
if(!SQL::ExistsTable(SQL_PLAYERS_TABLE))
{
//If not, then create a table called 'players'.
new handle = SQL::Open(SQL::CREATE, SQL_PLAYERS_TABLE); //Opening a valid handle to create a table called 'players'
SQL::AddTableColumn(handle, "p_id", SQL_TYPE_INT, 11, true); //Setting auto-increment for this field.
SQL::AddTableColumn(handle, "p_name", SQL_TYPE_VCHAR, 24);
SQL::AddTableColumn(handle, "p_password", SQL_TYPE_VCHAR, 64);
SQL::AddTableColumn(handle, "p_score", SQL_TYPE_INT);
SQL::AddTableColumn(handle, "p_posx", SQL_TYPE_FLOAT);
SQL::AddTableColumn(handle, "p_posy", SQL_TYPE_FLOAT);
SQL::AddTableColumn(handle, "p_posz", SQL_TYPE_FLOAT);
SQL::Close(handle);//Closing the previous opened handle.
}
new field that needs to be added
SQL::AddTableColumn(handle, "health", SQL_TYPE_FLOAT);
The text was updated successfully, but these errors were encountered: