Command Line


The following parameters can be used to run the application from the command line. Some examples are available here.

HELP

-?, -H, -HELP

Displays the list of commands available.

CONNECT

-CONNECT(<server>[,<username>[,<password>[,<KBname>]]])

This option enables you to connect to the CAST Knowledge Base without using a Knowledge Base Connection Profile.

  • <server> specify the name of the server that host the CAST Knowledge Base
  • <username> specify a valid username to access the server
  • <password> specify the password that corresponds to the <username>
  • <KBname> specify the name of the CAST Knowledge Base you want to connect to

Notes

  • This option MUST ALWAYS be used with the -DATABASE option
  • CAST recommends using the -CONNECT_PROFILE command when connecting to a CAST Knowledge Base.

CONNECT_PROFILE

-CONNECT_PROFILE(<profilename>)

Use this option to connect to Report Center. Specify the name of the profile that you want to use to connect.

DATABASE

-DATABASE(<database_type>)

Use this option to specify the type of Central Site you want to connect to:

  • CastStorageService > Knowledge Base installed in CAST Storage Service environments
  • Oracle > Knowledge Base installed in Oracle environments
  • SqlServer > Knowledge Base installed in Microsoft SQLServer environment

Notes

  • This option MUST ALWAYS be used with the -CONNECT option

LOG

-LOG(<filename>,[<arguments>],[<maxlines>])

Initializes the log file.

  • <filename> specify the name and location of the output log file (use the .castlog extension)
  • <arguments> is used to set the following log file parameters:
    -USELOGFILE activates the use log file mode
    -IMMEDIATE activates the immediate save mode (i.e. entries will be written to the log file every time a message is sent by the server or by Report Center.)
    -TRUNCATE activates the truncate file mode (i.e. the log file will be emptied each time Report Center is executed.)
  • <maxlines> sets the log file's maximum length

Examples:

RCENTER.EXE -LOG(c:\log.castlog, -USELOGFILE)

Notes

  • If you need to specify more than one argument, please separate the arguments with a space: RCENTER.EXE -LOG(c:\log.castlog, -IMMEDIATE -TRUNCATE).
  • If you are only specifying one argument, you can also use the argument without a dash and without an initial space: RCENTER.EXE -LOG(c:\log.castlog,IMMEDIATE).
  • If you want to rapidly deactivate an option, you can use the "!" character after the dash: RCENTER.EXE -LOG(c:\log.castlog, -!IMMEDIATE -!TRUNCATE).

NOBEEP

-NOBEEP

Execute without sound.

SHOW

  • -SHOW(SQL) This code displays the SQL sent to the data server in the Log Window.
  • -SHOW(SQL_DATA) This code displays the SQL sent to the data server and the data returned by the data server in the Log Window.
  • <SQL_TIME<,time>> SQL_TIME displays the time required for each query sent to the server to be executed and "time" is an optional parameter that expresses in milliseconds when the SQL_TIME option should be displayed.

    For example, if the parameter -SHOW(SQL_TIME,100) were passed in the command line, only those SQL queries that had taken longer than 100 milliseconds to execute would be displayed.

    Please note that you can still use -SHOW(SQL_TIME) on its own.

Notes

  • Please do NOT append this code to your command line unless you have contacted CAST for further instructions.

EXIT

Use this option at the end of your command line - it will automatically close Report Center on completion of the other options you have defined. You can also use it in some circumstances to force Report Cengter not to display any dialog boxes during the command line process (i.e. by using it at the beginning of the command line, immediately after calling the .exe).

HREPORT

-HREPORT(<Requestfilename>[,<Targetfilename>[,<Stylefilename>[,<arguments>
[,<ExternalValues>]]]])

This option creates a report from the Knowledge Base in HTML format.

  • <Requestfilename> is the full path of the file which contains the query for the report. Two uses are possible:

    1) <Requestfilename> = ModelId:=Model_Identifier

    Use this to generate a report on a view using its identifier.

    2) <Requestfilename> = ModelName:=FOLDER1/FOLDER2/.../ViewName

    Use this to generate a report on a view created in CAST Enlighten using its name - please note that the name of the view cannot contain a closed parentheses ")".

  • <Targetfilename> is the full path of the HTML file to create
  • <Stylefilename> is the full path of the Cascading Style Sheet file.
  • <arguments> is used to set the following report options:
    USE_FRAME activate the Frame mode for report
    !USE_FRAME deactivate the Frame mode
    USE_ACTIVE_FRAME activate the Active Frame mode
    !USE_ACTIVE_FRAME deactivate the Active Frame mode
    USE_STYLE activate the use of Style Sheets
    !USE_STYLE deactivate the use of Style Sheets
    INSERT_STYLE activate the insertion of Style Sheets in the HTML Report
    !INSERT_STYLE deactivate the insertion of Style Sheets in the HTML Report
    SHOW_HEADERFOOTER activate the display of headers and footers (see Options (on a View) for more information
    !SHOW_HEADERFOOTER deactivate the display of headers and footers (see Options (on a View) for more information

    Combining <arguments>

    It is possible to combine any of the <argument> options listed above by using the "-" character before the option. Separation with commas is NOT necessary (and would corrupt the command line):

    -HREPORT(c:\AllTableInfo.hsq,c:\out.htm,c:\cwstyles.css, -USE_FRAME -!USE_STYLE -SHOW_HEADERFOOTER)

  • <ExternalValues> is used for templates that are awaiting external values (HSQ files with the following keywords: "InputData:=","InputBox:=","InputList:=")

    If several external values are used, the "+" character is used to specify them in series:

    SERVERNAME=Server1+TABLENAME=Table1

    If, however, you want to include the "+" character in the value then please use the "\" character to separate the "+" characters that are values:

    VALUE1=C\+\++VALUE2=VB - this indicates VALUE1 has the value "C++" and --> VALUE2 has the value "VB".

    If you want to use commas to distinguish two possible values (for example to insert VALUE='VB','PB'), please use the following syntax:

    VALUE='VB'^comma^'PB'

    To summarize, values can be entered as follows:

    Value 'Value'
    "Value"


    Other possible syntaxes are as follows:

    VALUE="VB"
    VALUE="VB,LANGUAGE"
    VALUE="c:\\FOLDER1\\FOLDER2"
    VALUE="VB,LANGUAGE"+VALUE2="PB"

    Finally, if you have values that include spaces, such as "Admin Tool" in the following example:

    VALUE=Admin Tool+SNAP_ID=1

    You must use quotation marks to surround the value AND the parameter as shown here:

    "VALUE=Admin Tool+SNAP_ID=1"

    Thus giving the following in the following examples:

    RCENTER.EXE -HREPORT(c:\test.hsq,c:\out.htm,c:\cwstyles.css, ,"SERVERNAME=Server Name")
    RCENTER.EXE -HREPORT(c:\SchemaInfo.hsq,c:\out.htm,c:\cwstyles.css, ,"SERVERNAME=Server Name+SCHEMANAME=MySchema")

    Note that in this case, you must NOT use quotations around the value and the parameter at the same time. As such the following syntax is incorrec "VALUE="Admin Tool"+SNAP_ID=1".

Examples:

  1. For use with a Standard Template:

    RCENTER.EXE -HREPORT(c:\AllTableInfo.hsq,c:\out.htm,c:\cwstyles.css)
  2. HTML Report for a View:

    RCENTER.EXE -HREPORT(ModelId:=1,c:\out.htm,c:\cwstyles.css)
  3. For use with a template and several external values:

    For the template SchemaInfo.hsq, two external values are necessary:

    /*InputList:=Please specify Server name,SERVERNAME;Query:=Select SrvNam from CASTKB.Srv*/

    /*InputList:=Please specify schema name,SCHEMANAME;Query:=Select t1.DbeNam from CASTKB.Dbe t1, CASTKB.Srv t2 where t1.IdSrv = t2.IdSrv and upper(t2.SrvNam) = upper('SERVERNAME')*/

    RCENTER.EXE -HREPORT(c:\SchemaInfo.hsq,c:\out.htm,c:\cwstyles.css, ,SERVERNAME=Server1+SCHEMANAME=MySchema)

HDIAGNOSTIC

-HDIAGNOSTIC(<Requestfilename>[,<Targetfilename>[,<Stylefilename>
[,<arguments>]]])

This option is used to carry out a Diagnostic Report. Use the same values as described above.

HREPORTLIST

-HREPORTLIST(<Requestfilename>)

This command enables you to execute one or more reports from one command line.

  • <Requestfilename> specifies the name and full path of the file that contains the list of reports to be executed.

The file can be called anything and can be any type (.TXT for example). Specify the list of reports you want executing in the normal manner:

-HREPORT(c:\work\t.hsq,f:\work\t\t.htm)
-HREPORT(c:\work\t2.hsq,f:\work\t\t2.htm)
-HREPORT(c:\work\t3.hsq,f:\work\t\t3.htm)

Example:

"c:\program files\CAST\SQL Server\rcenter.exe"-CONNECT_PROFILE(BERTIE)-LOG(d:\cast\log.castlog, -USELOGFILE)-HREPORTLIST(c:\report.txt)-EXIT

Examples

"c:\program files\CAST\SQL Server\rcenter.exe"-CONNECT_PROFILE(BERTIE)-LOG(d:\cast\log.castlog, -USELOGFILE)-HREPORT(c:\AllTableInfo.hsq,c:\out.htm,c:\cwstyles.css)-EXIT

Notes

  • Please make sure you use uppercase letters to input the command line parameters (as in -LOG, -EXIT). The procedure will fail otherwise.

CAST Website