目前,我是第一次使用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 ..!!请分享您的评论
发布于 2017-10-12 17:12:12
1)在这里,您告诉Exasol读取文件夹EXASolutionConfig中的配置文件profile_PROD_talend,并在安静模式(-q)下执行文件D:/Data/Customer/PROD/EXASolution_SQL/EXASOL_data_script.sql。
-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文件传递一些参数。因此,您将传递三个参数(databaseName、tableName和/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 -- dualhttps://stackoverflow.com/questions/46500760
复制相似问题