sql loader脚如何工作?

时间:2017-09-30 07:55:02

标签: sql database windows sql-loader exasolution

目前我第一次使用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 ..!!

请分享您的意见

1 个答案:

答案 0 :(得分:0)

1)在此您要求Exasol阅读文件夹profile_PROD_talend中的个人资料EXASolutionConfig,并以安静模式D:/Data/Customer/PROD/EXASolution_SQL/EXASOL_data_script.sql)执行文件-q

来自the manual

-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