Beginner SQL problem

Slowpoke

The Mad Modder
Joined
Sep 30, 2010
Messages
1,321
I'm still just getting the hang on how to use sql. How do you increase the yield of the palace? This is what I'm trying:

UPDATE Building_YieldChanges SET 'Yield' = 4
WHERE BuildingType = 'BUILDING_PALACE' YieldType = 'YIELD_SCIENCE';

This is probably way off, but kael's pdf unfortunately doesn't have any simple sql examples.
 
So I haven't really gotten into the CiV DB yet (hopefully this weekend) but assuming your table, row and column names are all legit, it looks like you're just missing an AND. When the game parses from XML to SQL statements, it seems to to add these in automatically so you can set multiple statements into your WHERE clause without an AND. However, if you want to write the SQL yourself, you'll need valid SQL syntax, so try:

UPDATE Building_YieldChanges SET 'Yield' = 4
WHERE BuildingType = 'BUILDING_PALACE' AND YieldType = 'YIELD_SCIENCE';

Again, this is solely from my knowledge of SQL, nothing CiV specific, so there may be other problems here.
 
Awesome, I'll try it out later :)
 
Back
Top Bottom