Working With MaxDB SQLCLI
Working With MaxDB SQLCLI
Applies To:
Technologies - MaxDB
Article Summary
This article explains how to work with all SQLCLI commands. Screen shots are provided. By : Kathirvel Balakrishnan Title : Project Engineer, Wipro Technologies Date : 10 March 2005
Introduction to SQLCLI
SQLCLI is a database tool provided by MaxDB, using which database instances can be accessed using the SQL commands. This SQLCLI is a command line tool using which databases can be accessed interactively in local and remote systems. SQLCLI provides the following two main functionalities, 1. Executes the SQL statements on the MaxDB Database instances 2. Execute a set of its own commands that provide additional information.
Method 1 In this method we can just login into SQLCLI, but to proceed further we need a user name and password to perform other actions. The command SQLCLI just opens the SQLCLI command line console Page 1 of 13
From here one can specify the connect statement for a database along with user name and password to login The command is \c d <database_name> -u <user_name>,<password>
Page 2 of 13
Method 2 In this method we can login into SQLCLI with all the necessary information in one line, as SQLCLI d <database_name> -u <user_name>,<password>. This will open the SQLCLI, then the command \c is executed to connect to the database instance.
Method 3 In this method we can login into SQLCLI with the database, as SQLCLI d <database_name>. This will open the SQLCLI, then the command \c -u <user_name>,<password> is executed so that the user is to connect to the database instance.
Page 3 of 13
Page 4 of 13
Shell Command ( \! ) This command helps to execute a shell script. Image that now the user is in SQLCLI, and needs the DBMCLI console to perform a modification, in such case this command is much helpful. The syntax is \! <Shell Command>
Page 5 of 13
Auto commit Command (\a) This command can activate and deactivate the auto commit mode of the SQLCLI. The command \a on - activate auto commit and \a off - deactivates it.
Page 6 of 13
Align Command (\al) The output of an executed query can be formatted using this align command. The command \al on Activates it and the command \al off Deactivates.
Connect Command (\c) This command is used to connect to a database instance. The syntax is \c , or \c <database> -u <username>,<password>
Page 7 of 13
Command for requesting information about Database objects The command \dc is used to get the column information of a table. The syntax is \dc <pattern> where pattern = <username>.<objectname>. The command \de is used to get the list of index object. The syntax is \de <pattern> where pattern = <username>.<objectname>.
The command \dv is used to get the view information of a table. The syntax is \dv <pattern> where pattern = <username>.<objectname>. Page 8 of 13
The command \du is used to get the list of user for the object. The syntax is \du.
Connection Close Command (\di) The command \di is used to terminate the established with a database instance.
Page 9 of 13
Changing Field separator Command (\f) Normally the field separator used by default is | , in if this is to be changed this command can be used. The syntax is \f <separator>.
Changing SQL mode command (\m) The SQL mode can be modified using the \m command. The syntax is \m <mode> in case \m alone is used the mode is put to INTERNAL.
Page 10 of 13
Displaying the general database information (\s) The general information about the database can be displayed using the status (\s) command.
Page 11 of 13
Exiting from SQLCLI The SQLCLI console can be used using the command \q or quit.
Thanks for reading and hope this material was useful to you. Page 12 of 13
Author Bio
Kathirvel Balakrishnan is a Project Engineer for Wipro Technologies. His areas of interest are ABAP and Java Programming.
Copyright 2004 SAP AG, Inc. All Rights Reserved. SAP, mySAP, mySAP.com, xApps, xApp, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product, service names, trademarks and registered trademarks mentioned are the trademarks of their respective owners.
Page 13 of 13