You can execute SQL scripts from a file directly in the solidDB SQL Editor (solsql) or by specifying the script filename in the solsql startup command line.
Executing an SQL script with solsql
The syntax for script calls in solsql is: @filename
For example:
---Execute the SQL script named "insert_rows.sql" in the -- root ("\") directory of the C: drive. @\c:\insert_rows.sql;
Both absolute and relative path names are supported. If you specify a relative path, it must be relative to the solsql working directory.
Executing an SQL script from a file at the solsql startup
To execute an SQL script from a file at solsql startup, the name of the script file must be given as a command line parameter:
solsql network_name username password filename
All statements in the script must be terminated by a semicolon. solsql exits after all statements in the script file have been executed.
Remember to commit work at the end of the SQL script or before exiting solsql. If an SQL string is executed with the option -e, commit can only be done using the -a option.