08-15-2018 12:55 PM
Hi All, I've run into an issue using CVP Studio 11.6.1 DB Element. I am attempting an INSERT into a custom MS SQL 2014 database on a custom server.
The first two fields are integer and the third a varchar(50).
Sample INSERT statement is: INSERT INTO TABLE_NAME (RouterCallKeyDay, RouterCallKey, IPIVR) VALUES ({Data.Session.routercallday},{Data.Session.routercallkey},'{LocalVar.IVRIPAddress}')
When I look at SQL Profiler on the custom server, I am receiving:
exec sp_executesql N'INSERT INTO TABLE_NAME (RouterCallKeyDay, RouterCallKey, IPIVR) VALUES (152532,644,''199.139.52.45'')
I am receiving two single quotes around the variables I am attempting to single quote. SQL insert then fails. If I try the INSERT statement without any single quotes, I receive no single quotes and the SQL insert fails:
INSERT INTO TABLE_NAME (RouterCallKeyDay, RouterCallKey, IPIVR) VALUES ({Data.Session.routercallday},{Data.Session.routercallkey},{LocalVar.IVRIPAddress})
When I look at SQL Profiler on the custom server, I am receiving:
exec sp_executesql N'INSERT INTO TABLE_NAME (RouterCallKeyDay, RouterCallKey, IPIVR) VALUES (152532,644,199.139.52.45)
Any assistance would be appreciated. Thanks!
Solved! Go to Solution.
08-29-2018 11:16 AM
Update: I was able to solve this issue by doing the following for my SQL Query using double quotes:
SET QUOTED_IDENTIFIER OFF;INSERT INTO TABLE_NAME (RouterCallKeyDay, RouterCallKey, IPIVR) VALUES ({Data.Session.routercallday},{Data.Session.routercallkey},"{LocalVar.IVRIPAddress}");SET QUOTED_IDENTIFIER ON
Thanks
08-17-2018 04:41 PM
If you're using the built-in Database element, what is the value of SQL Query under the Element Settings?
Check the application logs for some more details on the failure. C:\Cisco\CVP\VXMLServer\applications\[app]\
08-29-2018 10:51 AM
Driver name changed from 11.0 to 11.6.Have you changed it accordingly in context.xml
08-29-2018 11:16 AM
Update: I was able to solve this issue by doing the following for my SQL Query using double quotes:
SET QUOTED_IDENTIFIER OFF;INSERT INTO TABLE_NAME (RouterCallKeyDay, RouterCallKey, IPIVR) VALUES ({Data.Session.routercallday},{Data.Session.routercallkey},"{LocalVar.IVRIPAddress}");SET QUOTED_IDENTIFIER ON
Thanks
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide