0

目前我第一次使用 Exasol 数据库并遇到了一个脚本,该脚本负责运行用 .sql 文件编写的 sql 脚本。

这是脚本

C:\Program Files\EXASOL\EXASolution\EXAplus\exaplusx64.exe -configDir EXASolutionConfig -profile profile_PROD_talend -q -f D:/Data/Customer/PROD/EXASolution_SQL/EXASOL_data_script.sql -- databaseName tableName /exasolution/StageArea/fileName.csv

我想知道,这个脚本是如何工作的以及它实际上在做什么?到目前为止我所理解的如下

首先“C:\Program Files\EXASOL\EXASolution\EXAplus\exaplusx64.exe”在命令行上启动一个 Exasol,然后它指向 .sql 文件所在的脚本。

没有得到:

1) What this part is doing "-configDir EXASolutionConfig -profile profile_PROD_talend -q -f "?


2) What are these identifiers doing "-q -f "?

3)After launching exaplusx64.exe, Is exasol going to connect with database and table name mentioned in script ? If then How cav file is paying its role in this script ? I mean in .sql there is just an sql statement, If its taking data from file then how ? I'm not getting this ..!!

请分享您的意见

4

1 回答 1

0

1) 在这里您告诉 Exasol 读取文件profile_PROD_talend夹中的配置文件并以安静模式 ( )EXASolutionConfig执行文件。D:/Data/Customer/PROD/EXASolution_SQL/EXASOL_data_script.sql-q

手册

-configDir *This is not actually in the EXASOL manual, I assume it's the folder with the profiles, or maybe it does nothing*
-profile Name of connection profile defined in <configDir>/profiles.xml (profiles can be edited in the GUI version). You can use a profile instead of specifying all connection parameters. 
-q Quiet mode which suppresses additional output from EXAplus.
-f Name of a text file containing a set of instructions that run and then stop EXAplus.

2) 文件名的安静模式和标志。

3) 当您运行此命令时,EXAPlus 使用配置文件中提供的信息连接到数据库,它将执行.sql传递的文件。

现在事情变得有趣了,--允许您将一些参数传递给.sql文件。因此,您传递了三个参数(databaseNametableName/exasolution/StageArea/fileName.csv)。如果您打开 sql 脚本,您会发现&1&2&3,这些是您的命令传递的参数的占位符。

再次从手册中:

-- <args> SQL files can use arguments given over via the parameter “-- ” by evaluating the variables &1, &2 etc. .

For example, the file test.sql including the content
--test.sql
SELECT * FROM &1;

can be called in the following way:
exaplus -f test.sql -- dual
于 2017-10-12T09:12:12.077 回答