Databases Reference
In-Depth Information
Connecting to an Essbase server
Obviously, you will need to be connected to an Essbase server to perform any tasks
or functions. In EssCmd there are two ways to login to the server. If your script will
only be accessing one specific Essbase database you can code your login command
as follows:
LOGIN ServerName userID Password appName dbName;
This command will log you into a specific Essbase Application|Database, and you will
need to log out before you can connect to another Application|Database. The appName
and dbName parameters are optional however, and if you plan on performing tasks
against several Application|Databases you would login like this:
LOGIN hostNode userName password;
SELECT appName dbName;
The term hostNode refers to the specific server name or IP address of the Essbase
server you wish to connect to.
Using the LOGIN then SELECT method to login allows you to change the
Application|Database at any time in your script by using another occurrence
of the SELECT command.
Your EssCmd script should now look like this:
OUTPUT 1 "c:\EssCmd.log"; /* The 1 specifies turning job log output
on and then you code the logs location */
LOGIN hostNode userName password; /* Connect to Essbase server */
SELECT appName dbName; /* Connect to specific application/database */
What about error checking
Before we go too much further, we should stress the importance of error checking.
Lucky for us the EssCmd library includes an IFERROR command that acts as a GOTO
for errors. This can be very important if the next command in a script is dependent
on the successful completion of the previous command. Having your script halt
execution on an error can prevent all kinds of grief.
It is a good idea to follow all commands in the script with the IFERROR command
and you can add your error checking as shown:
IFERROR "ERROR"; /* On an error the script will branch to the
"ERROR" line */
:ERROR /* Script skips to here and resumes execution */
EXIT; /* In this case we exit the script */
 
Search WWH ::




Custom Search