SQL Query not working

Answered Question
Jul 23rd, 2010

Hi all,

I am working for contact center, and at last, i am facing problem to store some data for user required reports.

My normal query with static values is working good but when i am trying to add some veriable in place of hard values the DB Write step is forwarded to SQL Error.

Can anyone help me to write SQL Query containing variable like ANI, Account Number, Call Time.

Best Regards

Kashif

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.5 (2 ratings)
Loading.
kashifsurhio Fri, 07/23/2010 - 05:34

Thanks Jonathan,

I have tried the $sign before variable name and tested it without any call, simply start step, set veriables, DB Write step and DB Release Step etc and it works fine.

Now the only problem is with Date veriable.

In SQL Server2005, table column is defined as datetime. Sample script looks as below:

Insert into BalanceInquiry
(CDR,CNIC,DateAndTime,ANI,DurationOnIVR,TransactionStatus,AccountNumber)
Values('9798','4210112345678','26-March-2010','1234','34','live','12345')

At the very first instance, after accepting the call, i am getting system current Date and time with "D[now]". it returns date and time in date type veriable in the below format:

D[July 23, 2010 5:34:21 PM]

So it throws SQL Exception in DB Write step. Kindy help.

Regards

Kashif Surhio

kashifsurhio Sat, 07/24/2010 - 00:15

Thanks geoff, I had solved the time issue as well.

I have to change date and time in GMT Format and then replace first two spaces with "-", also for GMT+5 time, I just updated the string to save the required time.

Actions

This Discussion