首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >sql加载器脚本是如何工作的?

sql加载器脚本是如何工作的?
EN

Stack Overflow用户
提问于 2017-09-30 15:55:02
回答 1查看 182关注 0票数 0

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

这是脚本

代码语言:javascript
复制
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文件所在的脚本。

没有得到:

代码语言:javascript
复制
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 ..!!

请分享您的评论

EN

回答 1

Stack Overflow用户

发布于 2017-10-12 17:12:12

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

来自the manual

代码语言:javascript
复制
-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,这些是命令传递的参数的占位符。

再次从手册中摘录:

代码语言:javascript
复制
-- <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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46500760

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档