Hi
I've got a little modmod that I'd like to use to grant a magistrate to a certain building. Since I use the modmod both with/without a certain mod (Events and Decisions) I'd however like to make a check to see if E&D is active so I thought I'd check if the Building_ResourcePerEra table is in the database (E&D adds this table to the database).
Unfortunately I'm not a great sql-coder and my code below doesn't work - I just get an error message saying that the table doesn't exist. I was hoping someone could help?
The code goes:
Any help would be much appreciated
\Skodkim
I've got a little modmod that I'd like to use to grant a magistrate to a certain building. Since I use the modmod both with/without a certain mod (Events and Decisions) I'd however like to make a check to see if E&D is active so I thought I'd check if the Building_ResourcePerEra table is in the database (E&D adds this table to the database).
Unfortunately I'm not a great sql-coder and my code below doesn't work - I just get an error message saying that the table doesn't exist. I was hoping someone could help?
The code goes:
Spoiler :
Code:
INSERT INTO Building_ResourcePerEra (
BuildingType, ResourceType, Quantity, InitialQuantity)
SELECT 'BUILDING_XXX', 'RESOURCE_YYY', '1', '1'
WHERE EXISTS(SELECT name FROM sqlite_master WHERE type='table' AND name='Building_ResourcePerEra');
Any help would be much appreciated
\Skodkim