Command Line

The command line refers to using commands in the form of strings in DOS-like environment to execute programs. All operating systems support the command lines, like the Linux console and the Windows command line window.

The esprocx.exe file, which is located in the esProc\bin path in esProc’s installation directory, is needed when using the command line to execute an esProc cellset file.

6.1.1 Cellset files without return results

Use the esprocx command to execute a cellset file at command line. Take the following cellset file, D:\files\output1.dfx, as an example:








for 100





Cellset files without return results are usually those that access data in files or databases. In the above cellset, for example, some simulation data is created and stored in the text file Data1.txt. When using an esprocx command, enter the to-be-executed script file after it; during execution, prompts of start and end will be displayed on the screen, as shown below:

After the execution, the randomly generated data will be written into Data1.txt, as shown below:

If the path in which the esprocx file is located is included into the operating system’s path list, run the file directly instead of running it in the esProc\bin path of the installation directory. But the to-be-called script file must be entered in its full path, or should be located in the current path. For example:

If the to-be-executed cellset file uses parameters, enter their values, separated by spaces, after the script file when executing the esprocx command. Take the following cellset file D:\files\output2.dfx as an example:








for IDs





The file uses two parameters: IDs and Value, as shown below:

The cellset is to import the Data1.txt file just created, modify some of the records with specified sequence numbers to make their Amount fields eqivalent to the specified Value, and store these records in the file again. The prompts displayed on the screen during execution are as follows:

Two parameters, one is a sequence [2,3,5,7,11], and the other is an integer 99999, are input while the cellset file, output2.dfx, is called. Similar to a cross-cellset call, the input parameters will be assigned to the cellset parameters according to their order instead of their names during the command line call. In this case [2,3,5,7,11] is assigned to the first parameter IDs and 99999 is assigned to the second parameter Value. After the command line is executed, data in Data1.txt will have been modified:

6.1.2 Cellset files with return results

When using the esprocx command directly at the command line, by default the result won’t be displayed on the screen. To display the return result of the script file, use -R option in execution. Similar to the cellset file called by the call function, the script file must return the result using return statement. Take the following cellset file, D:\files\calculate1.dfx, as an example:








return A1

return B1

This cellset will return the total number of days of the month in which the specified date occurs and compute what day the specified date is. It uses Day as one of its parameters:

Let’s first look at the execution with -R option:

Here no parameter has been set for the execution and a default one, 01/01/2000, is used for the computation. You can see that A2 and B2 respectively return a result using return statement. The results will be listed respectively after computation.

To set a parameter, it should be the date type. As a parameter of date type or time type has its own format, you need to set the format in the configuration file raqsoftConfig.xml located in esProc\config path in esProc’s installation directory:


<dateFormat> yyyy-MM-dd</dateFormat>


<dateTimeFormat> yyyy-MM-dd HH:mm:ss</dateTimeFormat>


The execution is what the following shows if a parameter has been set for the call:

This time you get the total number of days of the month in which February 22, 2012 occurs and the day of the week for this date.

Different from the previous cellset file, the following D:\files\calculate2.dfx returns results as a sequence:








return [A1,B1]


The execution is as follows:

Members of the resulting sequence are listed respectively, each having a line.

Here comes the last sample of the cellset file - D:\files\calculate3.dfx:





$(demo) select * from CITIES

$select * from STATES






return A3


The cellset file uses a parameter - Letter:

This cellset uses the database data. Here the database connection needs to be configured in the raqsoftConfig.xml file in the esProc\config path in the esProc installation directory:

<DBList encryptLevel="0">

<DB name="demo">

<property name="url" value="jdbc:hsqldb:hsql://"/>

<property name="driver" value="org.hsqldb.jdbcDriver"/>

<property name="type" value="13"/>

<property name="user" value="sa"/>

<property name="password" value=""/>

<property name="batchSize" value="1000"/>

<property name="autoConnect" value="true"/>

<property name="useSchema" value="false"/>

<property name="addTilde" value="false"/>


</DBList >

Please refer to related documents for detailed configuration method.

When the program is executed, the result is as follows:

To set a parameter of string type, it’s not necessary to surround it with double quotation marks, just enter it directly. Cities whose names start with letter B are listed in the above result. For a result of table sequence type or record sequence type, each record occupies a line and fields are separated from each other by tabs.

The above-mentioned configuration file, raqsoftConfig.xml, is also shared by the Integrated Development Environment (IDE), so information, like date format and datasource configuration, can be edited on the IDE interface. Click Tool>Option on the menu bar and configure the information on the Option window’s Environment page:

Click Tool>Datasource connection in Datasource manager to configure database connection parameter and other information. For details, refer to Database Configuration.

6.1.3 Executing cellset script and simple SQL

We can add -c option after an esprocx command to execute an input cellset script. In the cellset script, columns are separated by the Tab and lines are separated by the carriage return. Press Ctrl+C to finish the input and start execution. For example:

After starting the execution of esprocx –c, the following script is input:

[]  >10.(A1=A1|#)


According to the cellset script, ten numbers are added to A1’s empty sequence and line 2 exports the sequence to the console. After pressing Ctrl+C, we get the output result in the console.

To view the result of executing the cellset script, the common way is to add -r option, as shown below:

By executing esprocx –r –c, we get the result of computing the cellset script. If there isn’t a return statement in the cellset script, the command will return the value of executing the last cell.

We can also execute a simple SQL statement at the command line to query a data file on the main directory. For example:

Usually -r option is used when executing a simple SQL statement. For more information about executing simple SQL at command line, see Simple SQL. To query database data, certain settings need to be first completed in raqsoftConfig.xml file.