Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

SQL Query not working

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

1 ACCEPTED SOLUTION

Accepted Solutions
Green

Re: SQL Query not working

Use the Expression Editor to convert it into the format that SQL allows.

Regards,

Geoff

5 REPLIES
VIP Super Bronze

Re: SQL Query not working

Including your SQL statement would have helped. CCX variables need to be prefaced by the $ symbol.

Please remember to rate helpful responses and identify helpful or
New Member

Re: SQL Query not working

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

Green

Re: SQL Query not working

Use the Expression Editor to convert it into the format that SQL allows.

Regards,

Geoff

New Member

Re: SQL Query not working

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.

Re: SQL Query not working

Kashif can you share the expression how did u change the formate for SQL

651
Views
4
Helpful
5
Replies