Hi all,
I am trying to connect to an external database as a proof of concept for a few different things including CLI pre-authentication and VIP caller ID for execs and the like to get special IVR treatments. I tested the SQL query directly on the DB and it works but I am getting the below responses in iHub.
Has anyone had a similar experience? I'm a beginner with Groovy and I haven't found any fixes online (believe me, I've searched!)
First draft
result = context.sqlSelect('<dbHost>', 1000, "SELECT [name] FROM [<dbName>].[dbo].[<dbTable>] WHERE [cli] = <cli>","")
Each time the script is run, the value after AsyncSqlRowsResponseImpl@ is different. It appears the query is successful but I am not getting the data I need
<response>
<status>success</status>
<variables>
<variable name="result" value="com.speechstorm.indy.sql.AsyncSqlRowsResponseImpl@5b9acb6e"/>
</variables>
</response>
Current draft
result = context.sqlSelect('<dbHost>', 1000, "SELECT [name] FROM [<dbName>].[dbo].[<dbTable>] WHERE [cli] = <cli>","").getRows()
This one appears to fail due to com.microsoft.sqlserver.jdbc.SQLServerException: (The index 1 is out of range.) but the query has not changed.
<response>
<status>error</status>
<variables>
<variable name="ErrorDescription" value="javax.script.ScriptException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Failed to execute statement: SELECT [name] FROM [<dbName>].[dbo].[dbTable] WHERE [cli] = <cli>"/>
</variables>
</response>
Caused by: com.speechstorm.indy.scripting.ScriptletException: (javax.script.ScriptException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Failed to execute statement: SELECT [name] FROM [<dbName>].[dbo].[dbTable] WHERE [cli] = <cli>)
Caused by: javax.script.ScriptException: (java.util.concurrent.ExecutionException: java.lang.RuntimeException: Failed to execute statement: SELECT [name] FROM [<dbName>].[dbo].[dbTable] WHERE [cli] = <cli>)
Caused by: java.util.concurrent.ExecutionException: (java.lang.RuntimeException: Failed to execute statement: SELECT [name] FROM [<dbName>].[dbo].[dbTable] WHERE [cli] = <cli>)
Caused by: java.lang.RuntimeException: (Failed to execute statement: SELECT [name] FROM [<dbName>].[dbo].[dbTable] WHERE [cli] = <cli>)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: (The index 1 is out of range.)
#Integrations
------------------------------
Oscar Alvarez
Link Group
------------------------------