<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://modiki.civfanatics.com/index.php?action=history&amp;feed=atom&amp;title=DB.Query_%28Civ5_API%29</id>
	<title>DB.Query (Civ5 API) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://modiki.civfanatics.com/index.php?action=history&amp;feed=atom&amp;title=DB.Query_%28Civ5_API%29"/>
	<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=DB.Query_(Civ5_API)&amp;action=history"/>
	<updated>2026-06-09T16:24:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://modiki.civfanatics.com/index.php?title=DB.Query_(Civ5_API)&amp;diff=10853&amp;oldid=prev</id>
		<title>DonQuich: Bot update</title>
		<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=DB.Query_(Civ5_API)&amp;diff=10853&amp;oldid=prev"/>
		<updated>2012-09-19T18:33:36Z</updated>

		<summary type="html">&lt;p&gt;Bot update&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Civ5 API Beta Banner}}&lt;br /&gt;
&amp;#039;&amp;#039;This page is a part of the [[Lua and UI Reference (Civ5)]].&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TypeInfos5|Function.png|This function is a member of {{Type5|DB}}.&amp;lt;br/&amp;gt;&lt;br /&gt;
This is a static method, invoke it with a dot.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Executes an arbitrary SQL statement on the gameplay database and returns recordset.&lt;br /&gt;
In situations where the quick and easy enumeration that &amp;#039;&amp;#039;GameInfo&amp;#039;&amp;#039; provides is not enough and either updates to the database or a complex query such as a join is required, DB.Query can be used.  This method executes any arbitrary SQL command on the gameplay database and returns a recordset.  Variable arguments can be used in the SQL command.  For information about how to use literal arguments, see [http://www.sqlite.org/c3ref/bind_blob.html| here].&lt;br /&gt;
The SQL command does not actually get executed until the query is iterated.  Even if your statement is not intended to return a record set, you must still iterate it to cause the &amp;quot;Step&amp;quot; to occur.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Usage=&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;string&amp;#039;&amp;#039;&amp;#039; DB.Query&amp;lt;b&amp;gt;(&amp;lt;/b&amp;gt;&amp;#039;&amp;#039;&amp;#039;string&amp;#039;&amp;#039;&amp;#039; SqlStatement, &amp;#039;&amp;#039;&amp;#039;...&amp;#039;&amp;#039;&amp;#039; statement_args = nil&amp;lt;b&amp;gt;)&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returned Value&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:A valid database query on success, nil on error.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:{|&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; style=&amp;quot;padding-right:6px;&amp;quot;|SqlStatement:&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;| &amp;#039;&amp;#039;A SQL string.&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; style=&amp;quot;padding-right:6px;&amp;quot;|statement_args:&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;| &amp;#039;&amp;#039;One or many arguments that get injected into the SQL statement.&lt;br /&gt;
&amp;#039;&amp;#039;Can be of type nil,number, or string.&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; class=&amp;quot;civ5-example&amp;quot;&amp;gt;&lt;br /&gt;
-- Obtain all custom map options which are dropdowns for the current map script and their possible values.&lt;br /&gt;
-- NOTE: Does not include checkbox-based options.&lt;br /&gt;
local sqlGetCustomMapOptions =&lt;br /&gt;
{{Type5|select * from MapScriptOptions&lt;br /&gt;
where&lt;br /&gt;
exists&lt;br /&gt;
(select 1 from MapScriptOptionPossibleValues&lt;br /&gt;
where&lt;br /&gt;
FileName = MapScriptOptions.FileName and&lt;br /&gt;
OptionID = MapScriptOptions.OptionID) and&lt;br /&gt;
Hidden = 0 and&lt;br /&gt;
FileName = ?}};&lt;br /&gt;
local currentMapScript = PreGame.GetMapScript();&lt;br /&gt;
for option in DB.Query(sqlGetCustomMapOptions, currentMapScript) do&lt;br /&gt;
options[option.OptionID] = {&lt;br /&gt;
ID = option.OptionID,&lt;br /&gt;
Name = Locale.ConvertTextKey(option.Name),&lt;br /&gt;
ToolTip = (option.Description) and Locale.ConvertTextKey(option.Description) or nil,&lt;br /&gt;
Disabled = (option.ReadOnly == 1) and true or false,&lt;br /&gt;
DefaultValue = option.DefaultValue,&lt;br /&gt;
SortPriority = option.SortPriority,&lt;br /&gt;
Values = {},&lt;br /&gt;
};&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Source code samples=&lt;br /&gt;
&amp;#039;&amp;#039;Redundant occurences have been removed.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|AdvancedSetup.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/FrontEnd/GameSetup/AdvancedSetup.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0049}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for option in DB.Query(&amp;quot;select * from MapScriptOptions where exists (select 1 from MapScriptOptionPossibleValues where FileName = MapScriptOptions.FileName and OptionID = MapScriptOptions.OptionID) and Hidden = 0 and FileName = ?&amp;quot;, currentMapScript) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0061}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for possibleValue in DB.Query(&amp;quot;select * from MapScriptOptionPossibleValues where FileName = ? order by SortIndex ASC&amp;quot;, currentMapScript) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0184}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for option in DB.Query(&amp;quot;select * from MapScriptOptions where not exists (select 1 from MapScriptOptionPossibleValues where FileName = MapScriptOptions.FileName and OptionID = MapScriptOptions.OptionID) and Hidden = 0 and FileName = ?&amp;quot;, PreGame.GetMapScript()) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0401}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(sql) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|CivilopediaScreen.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/Civilopedia/CivilopediaScreen.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|1370}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;SELECT PortraitIndex, IconAtlas from Technologies ORDER By Random() LIMIT 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|1403}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;SELECT PortraitIndex, IconAtlas from Units ORDER By Random() LIMIT 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|1435}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;SELECT PortraitIndex, IconAtlas from UnitPromotions ORDER By Random() LIMIT 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|1467}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;SELECT PortraitIndex, IconAtlas from Buildings where WonderSplashImage IS NULL ORDER By Random() LIMIT 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|1499}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;SELECT PortraitIndex, IconAtlas from Buildings Where WonderSplashImage IS NOT NULL ORDER By Random() LIMIT 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|1531}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;SELECT PortraitIndex, IconAtlas from Policies Where IconAtlas IS NOT NULL ORDER By Random() LIMIT 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|1587}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;SELECT PortraitIndex, IconAtlas from Leaders where Type &amp;lt;&amp;gt; \&amp;quot;LEADER_BARBARIAN\&amp;quot; ORDER By Random() LIMIT 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|1645}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;SELECT PortraitIndex, IconAtlas from Terrains ORDER By Random() LIMIT 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|1683}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;SELECT PortraitIndex, IconAtlas from Resources ORDER By Random() LIMIT 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|1716}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;SELECT PortraitIndex, IconAtlas from Improvements ORDER By Random() LIMIT 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|CivilopediaScreen.lua (G&amp;amp;K)}}&lt;br /&gt;
:&amp;lt;code&amp;gt;DLC/Expansion/UI/Civilopedia/CivilopediaScreen.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0460}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for unit in DB.Query(&amp;quot;SELECT Units.ID, Units.Description, Units.PortraitIndex, Units.IconAtlas From Units where FaithCost &amp;gt; 0 and not RequiresFaithPurchaseEnabled and ShowInPedia == 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0489}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for unit in DB.Query(&amp;quot;SELECT Units.ID, Units.Description, Units.PortraitIndex, Units.IconAtlas From Units where PreReqTech is NULL and Special is NULL and (Units.FaithCost = 0 or RequiresFaithPurchaseEnabled) and Units.ShowInPedia = 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0714}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for building in DB.Query(&amp;quot;SELECT Buildings.ID, Buildings.Description, Buildings.PortraitIndex, Buildings.IconAtlas from Buildings inner join  BuildingClasses on Buildings.BuildingClass = BuildingClasses.Type where FaithCost &amp;gt; 0 and BuildingClasses.MaxGlobalInstances &amp;lt; 0 and BuildingClasses.MaxPlayerInstances &amp;lt;&amp;gt; 1 and BuildingClasses.MaxTeamInstances &amp;lt; 0;&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0752}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for building in DB.Query(sql) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|CivilopediaScreen.lua (G&amp;amp;K)}}&lt;br /&gt;
:&amp;lt;code&amp;gt;DLC/Expansion/Scenarios/SteampunkScenario/CivilopediaScreen.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|1588}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;SELECT PortraitIndex, IconAtlas from Policies ORDER By Random() LIMIT 1&amp;quot;) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|GameCalendarUtilities.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;Gameplay/Lua/GameCalendarUtilities.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0041}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query([[SELECT MonthIncrement, TurnsPerIncrement FROM GameSpeed_Turns WHERE GameSpeedType = ? ORDER BY rowid ASC]], gameSpeedType) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|MapmakerUtilities.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;Gameplay/Lua/MapmakerUtilities.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0466}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;select count(*) as count from Civilization_Start_Region_Priority where CivilizationType = ?&amp;quot;, civType) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0474}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query(&amp;quot;select count(*) as count from Civilization_Start_Region_Avoid where CivilizationType = ?&amp;quot;, civType) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|StagingRoom.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/FrontEnd/Multiplayer/StagingRoom.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|1019}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query([[SELECT&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|1020}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   Civilizations.ID as CivID,&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|1021}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   Civilizations.Description as CivDescription,&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|1022}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   Civilizations.ShortDescription as CivShortDescription,&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|1023}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   Leaders.Description as LeaderDescription&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|1024}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   FROM Civilizations, Leaders, Civilization_Leaders&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|1025}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   WHERE&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|1026}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   Civilizations.Playable = 1 AND&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|1027}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   Civilizations.Type = Civilization_Leaders.CivilizationType AND&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|1028}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   Leaders.Type = Civilization_Leaders.LeaderheadType&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|1029}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   ]]) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|UniqueBonuses.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/FrontEnd/GameSetup/UniqueBonuses.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0112}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query([[SELECT ID, Description, PortraitIndex, IconAtlas from Units INNER JOIN&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|0113}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   Civilization_UnitClassOverrides ON Units.Type = Civilization_UnitClassOverrides.UnitType&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|0114}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   WHERE Civilization_UnitClassOverrides.CivilizationType = ? AND&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|0115}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   Civilization_UnitClassOverrides.UnitType IS NOT NULL]], civ.Type) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0120}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query([[SELECT ID, Description, PortraitIndex, IconAtlas from Buildings INNER JOIN&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|0121}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   Civilization_BuildingClassOverrides ON Buildings.Type = Civilization_BuildingClassOverrides.BuildingType&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|0122}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   WHERE Civilization_BuildingClassOverrides.CivilizationType = ? AND&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|0123}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   Civilization_BuildingClassOverrides.BuildingType IS NOT NULL]], civ.Type) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0128}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for row in DB.Query([[SELECT ID, Description, PortraitIndex, IconAtlas from Improvements where CivilizationType = ?]], civ.Type) do&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Civ5 API Footer}}&lt;br /&gt;
[[Category:Civ5 Methods and Functions|Query]]&lt;/div&gt;</summary>
		<author><name>DonQuich</name></author>
	</entry>
</feed>