0

I have this teiid.groovy script to execute an SQL query on a Teiid VDB:

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();

When I execute it using

./adminshell.sh . /path/to/file/teiid.groovy

I get this error;

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
                             ^

What am I doing wrong? Thank you in advance.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Mardwan
  • 139
  • 3
  • 14

1 Answers1

1

You're using double quotes for your string, and its contents. Simply change the line to:

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

Also, the first line isn't groovy. Maybe try

sql = connect('jdbc:teiid:PREVIEW_d3cd3bd1-7b0a-4ca0-94f9-84e37ce7b106_iCare_P5_project.1@mm://localhost:31000', 'user1', 'user2014')  
tim_yates
  • 167,322
  • 27
  • 342
  • 338
  • Hi. Thank you so much for the reply. However, the error is within connect() not execute(). I have tried your suggestion either way and I am still getting the same error. – Mardwan Jul 09 '15 at 06:04
  • Yeah, I updated the answer, you had errors on 66% of your script ;-) – tim_yates Jul 09 '15 at 06:05