Teiid的groovy脚本(Admin Shell)出错

时间:2015-07-09 05:47:08

标签: groovy teiid

我有这个teiid.groovy脚本在Teiid VDB上执行SQL查询:

sql=connect(${jdbc:teiid:PREVIEW_d3cd3bd1-7b0a-4ca0-94f9-84e37ce7b106_iCare_P5_project.1@mm://localhost:31000}, {$user1}, ${user2014!});  
sql.execute("select * from ( exec "iCare_P5_Resident_Model"."iCare_P5_Resident_Proc"() ) AS X_X");  
sql.close();

当我使用

执行它时
./adminshell.sh . /path/to/file/teiid.groovy

我收到此错误;

FATAL: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
groovysh_parse: 2: expecting '}', found 'b0a' @ line 2, column 44.
{jdbc:teiid:PREVIEW_d3cd3bd1-7b0a-4ca0-9
                             ^

1 error

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
groovysh_parse: 2: expecting '}', found 'b0a' @ line 2, column 44.
{jdbc:teiid:PREVIEW_d3cd3bd1-7b0a-4ca0-9
                             ^

我做错了什么?提前谢谢。

1 个答案:

答案 0 :(得分:1)

您为字符串及其内容使用双引号。只需将行更改为:

sql.execute('select * from ( exec "iCare_P5_Resident_Model"."iCare_P5_Resident_Proc"() ) AS X_X')

另外,第一行并不常规。也许试试

sql = connect('jdbc:teiid:PREVIEW_d3cd3bd1-7b0a-4ca0-94f9-84e37ce7b106_iCare_P5_project.1@mm://localhost:31000', 'user1', 'user2014')