The SQL command line utility supports a set of commands in the script file or during interactive session. These commands are case insensitive; however, each command must be on separate line and must start at the beginning of the line. All commands are prefixed with the colon, ':', character except the GO command. The commands are executed immediately and not placed in the statement cache.
The SQL statements are cache in the statement buffer until the GO command is encountered, and then they are sent to the server in one batch. The optional count determines the number of times the batch will be executed. If there are "SELECT ..." statements in the batch, the server may execute the "SELECT ..." statement only when it is the last statement in the batch. If the last statement in the batch results in a cursor being returned, the complete result set is printed to the output.
|Note: In interactive mode, GO does not clear the statement cache. Only the :reset command clears the statement cache. This makes it possible to examine the statements using the :list command after failure. In batch mode (running from script file, GO does clear the statement cache.|
Clear the statement cache. The content of the statement cache are discarded without being executed.
Print the content of the statement cache to the output.
Make connection to server at the specified path using the optional protocol, user name and password. The valid protocols are: TCP (connecting to ADS using TCP/IP protocol), UDP (connecting to ADS using UDP/IP protocol) or ALS (connecting using Advantage local server DLL). If no protocol is specified, the default is to attempt to connect to remote server using all available protocol.
Make connection to the Advantage Database Server or Advantage Local Server using options specified in the connection string. See AdsConnect101 for connection string format.
:cs Data Source=d:\mydata\main.add; ServerType=Remote; User ID=user1; password=sample
:cs Data Source=d:\mydata; ServerType=Local;
Load addition batch commands from the specified file. The statements in the file are load and processed immediately. Any GO command in the file will cause statements in the cache to be executed. No implicit GO will be execute after loading the file. SQL statements from the file will stay in the statement cache if GO is not the last statement in the statement cache until a GO command is issued.
Exit the program. All unexecuted SQL statement in the statement cache are discarded.
List the available asqlcmd commands with a short description of each command.
Sample Command Script File or Interactive Session Sequence
UPDATE table1 SET quantity = quantity + 1 WHERE id = 2;
SELECT * FROM table1;
INSERT INTO table2 ( id, name ) VALUES ( 22, 'abc' );