IPIVR DB Write with SQL table with identity column

Unanswered Question
Sep 13th, 2008

I am looking into using the IPIVR DB Access module to write a simple transaction log. I have created a IVR script which happily reads data from one databse but when I want to write selected records with variable data to a new table I keep hitting null pointer errors but when I write explicit data then everything works fine. In the DB Write SQL I have entered

INSERT INTO Calls (DateTime, DNIS, ANI, UD1, UD2) VALUES ('2008-09-12', $varDNIS, $varANI, $varUD1, $varUD2)

where varxxx is an IPIVR script varaiable holding the variable contents, this operation fails. If I change to

INSERT INTO Calls (DateTime, DNIS, ANI, UD1, UD2) VALUES ('2008-09-12', 'DNIS', 'ANI', 'UD1', 'UD2')

i.e. explicit data, it works fine. The SQL table has an extra column, CallID, which is defined as primary key and also an Identity column (so automatically populated, as I don't want to manage the primary key column. Is this supported and is this the root of my problem ? If not any ideas why the INSERT is not working with variable data ?

Finally is there a way to capture the current Date and Time inside the IVR script to make up and populate the DateTime field, ala ICM DateTime field, in the INSERT command ?


I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
abramj Sun, 09/14/2008 - 12:27


I have created a second table, without the identity column setting for the primary key and I get exactly the same problem, i.e. I can write explicit (static) data withotu problem but when trying to use the $varname method I get a null exception pointer error. Is there some trick to configuring the variables (mine are all string and SQL columns are all char).


abramj Mon, 09/15/2008 - 09:06

Oops, missed SR2 for IPIVR 3.5(3) which as the fix for this, so basic writing variable data is now working.

Still interested in wyas to get Date and Time values for the using as a timestamp in the record though - any thoughts ?


BCOLE2007 Mon, 09/15/2008 - 09:44

Couple Ideas,

1) Use the Sysdate for your database on the insert

Oracle example:

INSERT INTO Calls (DateTime, DNIS, ANI, UD1, UD2) VALUES (SYSDATE, $varDNIS, $varANI, $varUD1, $varUD2)

2) Get the CRS system Time from a set, not sure this how it looks in 3.5

see screen shot attached

Database and CRS system time can be different

Let me know how it goes


*Please rate useful posts

emad.khurshid Tue, 04/02/2013 - 12:16

hello, i m getting the same Null exception while writing a String to the DB in varchar datatype. i m using UCCX 8.5, need some help. didnt get the point made by abramj

"ops, missed SR2 for IPIVR 3.5(3) which as the fix for this" as i have version 4.0 i believe. how to check the version of IP IVR.


This Discussion