[BNW] Help finding error in SQL

Very top of the file
Code:
INSERT INTO Building_FreeUnits (BuildingType, UnitType, Experience)
VALUES ('BUILDING_CATHEDRAL', 'UNIT_MISSIONARY', 1);

INSERT INTO Building_FreeUnits (BuildingType, UnitType, Experience)
VALUES ('BUILDING_MOSQUE', 'UNIT_MISSIONARY', 1);
Table Building_FreeUnits has no column called "Experience". This causes the game to stop reading anything from within the file at the point where this fatal syntax error occurs, with the result that nothing from the file is used.

The valid columns for table "Building_FreeUnits" are "BuildingType", "UnitType", and "NumUnits".

-------------------------------------------------

Your tag-names here are not correct:
Code:
INSERT INTO Building_ResourceYieldChanges (BuildingType, ResourceType, YieldType, Yield)
VALUES ('BUILDING_CIRCUS', 'IVORY', 'GOLD', 1);
INSERT INTO Building_ResourceYieldChanges (BuildingType, ResourceType, YieldType, Yield)
VALUES ('BUILDING_CIRCUS', 'HORSES', 'GOLD', 1);
There is no such resource as 'IVORY' nor 'HORSES'. Nor is there such a Yield-Type as 'GOLD'.

Correct tag-names are required, which are RESOURCE_IVORY, RESOURCE_HORSE, and YIELD_GOLD

-----------------------------------------------------

This is incorrect:
Code:
INSERT INTO Buildings (BuildingType, ExtraCityHitPoints)
VALUES ('BUILDING_GRANARY', 25);
  1. Table Buildings has no column called BuildingType. Buildings is a primary or "parent" table therefore Type is required instead of BuildingType
  2. Even with the correct column-names, the code would still not work because "INSERT INTO" means add a new row (or register) within the table, and "Buildings" already has a 'BUILDING_GRANARY' defined within it.
  3. What you want to do is an "UPDATE":
    Code:
    UPDATE Buildings SET ExtraCityHitPoints = 25 WHERE Type = 'BUILDING_GRANARY' ;
 
Last edited:
Top Bottom