Sets up a query for the campaign database.
- The name of a campaign database.
- SQL Query to prepare
Sets up a query.
This will NOT run the query; only make it available for parameter binding.
To run the query, you need to call SqlStep(); even if you do not expect result data.
Note that when accessing campaign databases, you do not write access to the builtin tables needed for CampaignDB functionality.
N.B.: You can pass sqlqueries into DelayCommand; HOWEVER they will NOT survive a game save/load. Any commands on a restored sqlquery will fail. It is highly recommended to not use sqlqueries with DelayCommand or AssignCommand at all.
This will prepare a SQL query for the campaign database specified. The campaign database is outside of a module, and a player character, meaning it can span modules and even characters. It also exists as a separate file that can be queried, or even edited, separately from the game itself.
While it isn't a very good use case, the sqlite DB created can be changed by other copies of the game or external tools with lock permissions on the filesystem (NFS is not supported).
To find out if a prepared query has completed successfully run SqlGetError.
This function was added in 1.80.8193.14 of NWN:EE.