Creating an ODBC connection on I-Server in Unix environment
Running the command-line MicroStrategy ODBC Test Tool
The command-line MicroStrategy ODBC Test Tool can be accessed by running the mstrtodbcx script:
1. From a Unix command prompt, go to the bin folder within the MicroStrategy Home directory:
cd <MSTR Home>/bin
where <MSTR Home> is the MicroStrategy Home Path. The MicroStrategy Home Path is specified during
installation.
2. Run the following mstrtodbcx script:
./mstrtodbcx
As will be seen in the following sections, all commands in the command-line MicroStrategy ODBC Test
Tool, besides SQL queries, begin with a period
(.).
Connecting to a database
From within the command-line MicroStrategy ODBC Test Tool, use the .connect command to connect to
a database. The syntax of the .connect
command is as follows:
.connect -d <DSN> -u <UserName> -p <Password>
For example, if the DSN is “TutorialWH”, the username is “tester”, and the password is “mypwd”, then
enter the command:
.connect -d TutorialWH -u tester -p mypwd
Running a SQL query
Once connected to a database, a SQL query can be run by typing the SQL within the command-line
MicroStrategy ODBC Test Tool. The SQL query can
be entered in multiple lines. The end of the SQL query is designated by a semicolon. All lines up to a final
semicolon will be sent to the database. For
EXAMPLE:
SELECT * FROM MyDBTable;
Disconnecting from the database
Use the .disconnect command to close the current ODBC connection.
.disconnect
Exiting the MicroStrategy ODBC Test Tool
To exit the MicroStrategy ODBC Test Tool, use the .exit, .bye, or .quit Command:
.exit