Administrator Guide : Using solidDB® data management tools : solidDB® SQL Editor (solsql) : Starting solidDB® SQL Editor (solsql)
  
Starting solidDB® SQL Editor (solsql)
Start solidDB® SQL Editor (solsql) with the command solsql, followed by argument options.
The syntax for starting solsql is:
solsql [options] [network_name] username [password]
where
options can be:
Option syntax
Description
-a
Autocommit every statement
-c dir
Change working directory
-e sql-string
Execute the specified SQL string
If you use this option, you can only use the -a option (autocommit) issue to commit work.
-f filename
Execute SQL strings from the specified file
Use this option to execute SQL statements programmatically from a script.
-o filename
Write result set to the specified file
-O filename
Append result set to the specified file
-S schema_name
Use only the specified schema
-C catalog_name
Use only the specified catalog
-t
Print execution time per command
-tt
Print the time of prepare, execute, and fetch operations per command
-2
Creates two connections to the database
You can switch between the two connections with the command switch.
-u
In Unicode databases (General.InternalCharEncoding=UTF8), expect the data in character and wide character data type columns to be encoded in UTF-8.
In partial Unicode databases (General.InternalCharEncoding=Raw), expect the data in wide character data type columns to be encoded in UTF-8. Data in character data type columns is not converted.
See Using solidDB® tools with Unicode for more information.
-m
In Unicode databases (General.InternalCharEncoding=UTF8), expect the data in character and wide character data type columns to be encoded in the console’s locale/codepage, despite the settings in the server-side and client-side character data binding parameters.
In partial Unicode databases (General.InternalCharEncoding=Raw), expect the data in wide character data type columns to be encoded in the console’s locale/codepage, despite the settings in the server-side and client-side character data binding parameters. Data in character data type columns is not converted.
See Using solidDB® tools with Unicode for more information.
-M locale_name
In Unicode databases (General.InternalCharEncoding=UTF8), expect the data in character and wide character data type columns to be encoded in the specified locale/codepage.
In partial Unicode databases (General.InternalCharEncoding=Raw), expect the data in wide character data type columns to be encoded in the specified locale/codepage. Data in character data type columns is not converted.
The format of locale_name depends on the operating system.
For example, in Linux environments, the locale name for the code page GB18030 in Chinese/China is zh_CN.gb18030.
In Windows environments, the locale name for Latin1 code page in Finnish/Finland is fin_fin.1252.
See Using solidDB® tools with Unicode for more information.
-h, -?
Help = Usage
-x onlyresults
Print only the rows of the result set
The SQL statement for which the rows are printed must be given using the -e sql-string option.
solsql -x onlyresults -e "SELECT * FROM customerid" "tcp 2315" dba dba
-x pwdfile: filename
Read password from the file specified with filename
-x stoponerror
This option forces a shutdown of solsql immediately when an error is detected.
-x returnerroronexit
This option displays return codes for SQL errors and user raised procedure errors. The possible return codes are:
Code 60: the execution of an SQL statement fails
Code 61: a procedure call returns an error
If several SQL statements or procedure calls fail during the execution of an SQL script, the returned code is that of the first failure.
-x outputsql
This option prints out the executed SQL commands instead of only printing out the results of each operation.
network_name is the network name of a solidDB® server that you are connected to. The given network name must be enclosed in quotation marks. Refer to Managing network connections for further information. Logical data source names can also be used with the solidDB® tools.
username is required to identify the user and to determine the authorization level of the user authorization. Without appropriate rights, command execution is denied.
password is the password of the user for accessing the database. The password is mandatory, if the password is not read from a file (defined with option -x pwdfile: filename), or optional, if the password is read from a file.
If the username and password are specified at the command line, the network_name must also be specified.
If the name of the SQL script file is specified at the command line (except with the -f option), the network_name, username, and password must also be specified.
Remember to commit work at the end of the SQL script or before exiting solsql.
The solidDB® tools connect to the first server specified in the Com.Connect parameter in the solid.ini file. If you specify no arguments, you are prompted for the database administrator user name and password.
Error messages
When there is an error in the command line, solsql gives you a list of the possible syntax options as a result. Check that the command line you entered is valid.
Exiting solsql
To exit solsql, enter the command exit.
Related reference
solidDB® SQL Editor (solsql)