cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
596
Views
0
Helpful
1
Replies

DBWrite step fails in AEF Script with error ArrayIndexOutOfBoundsException -1 or nullPointerException.

TASKER.DNVGL
Level 1
Level 1

Hey!

I am writing some values the user inputs into our script into a Database.

The values are "AgentID", and "CallingNumber", they are both strings.

I have two variables to do this:
$AgentID and $CallingNumber

I assign the $CallingNumber variable using "Get Call Contact Info", and i get $AgentID using a Get Digit String.

I can confirm that these variables get populated though the users interaction with the script.

However, if i then try to use a DB Write step, i encounter the following error message during reactive debugging:
"Exception"
-1; nested exception is:
java.lang.ArrayIndexOutOfBoundsException -1

If i test this normally, with values in the Variables (i.e. not reactive debugged, and hardcoded variable values) i receive:
java.lang.NullPointerException

The SQL statement used is:
DELETE FROM [OracleCSQ_Settings] where [Setting] = 'RedirectID'
DELETE FROM [OracleCSQ_Settings] where [Setting] = 'LastChangeBy'
INSERT INTO [OracleCSQ_Settings] VALUES ('RedirectID', $AgentID)
INSERT INTO [OracleCSQ_Settings] VALUES ('LastChangeBy', $CallingNumber)

I have tried also defining the field names in the INSERT INTO (i.e. insert into DB (field1, field2) VALUES (value1, value2)) however this does not change anything. I have also tried an "UPDATE" Statemtnt.
I have also tried specifying DBNAME.dbo.TABLENAME.

If i hardcode values into the SQL statement, it runs normally.

I've attached an image of the error.

Any ideas about what we can do here?
Oh, and to spice things up, in a blank script, i added only an Accept (Triggering Contact), and then Get Call Contact Info into 2 variables. (CallingNumber, CalledNumber), and i could insert those directly into the Database using a DB Write step.

1 Reply 1

TASKER.DNVGL
Level 1
Level 1

We actually solved this by removing all but one SQL Query per DB Write step, and removing all blank space after the actual SQL command.