Skip sql files?

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
How can I skip execution of a sql file?

I have about 120 files containing translations of my project text. These add 46 seconds to game load time. All but the chosen language can obviously be skipped, which cuts time down to 3 seconds. I tried skipping the file by producing an error from inserting an already-existing value into a table, but discovered it is not possible to use a WHERE clause for an INSERT INTO statement, so I can't make this depend on a value set by the user elsewhere.

On a related question, is it possible to automatically detect the local language? I currently have users set it with a setting in my options.sql file:

INSERT INTO Civup (Type, Value) VALUES ('LANGUAGE', 'EN_US');
 
but discovered it is not possible to use a WHERE clause for an INSERT INTO statement

It is, but you need to use the power of SQL ;)

INSERT INTO Table1(Col1, Col2)
SELECT 'Val1', 'Val2' FROM Table2 WHERE Col3 = 'Val3'
 
Back
Top Bottom