Skip to content

sql Open

Sub-commandData (SQL)New in Reforged
sql open {file|:memory:}
Sets
#SqlRes, #SqlCnt

Also searchable as: sql Open

sql open opens the database file for this script tab, creating it if it does not exist. An already open database is closed first.

Parameter Meaning
file Path of the database file. A relative path starts from #CurPath (the folder of EasyUOReforged.exe), the same rule as call.
:memory: A throw-away database that lives only until it is closed.
sql open C:\EasyUO\mychar.db
if #SqlRes <> OK
display ok Could not open the database: #SqlRes
halt

To use several files at once, attach them: sql exec ATTACH 'C:\data\other.db' AS other, then write other.table. ATTACH paths are relative to the working directory of EasyUO Reforged, not to #CurPath, so give a full path.

See Using SQL for how statements are written and how variables go in and out.

See also