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 ?