cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
643
Views
0
Helpful
3
Replies

CVP Studio 11.6 DB Element to Custom Database - Single quote becomes two single quotes

dldresser
Level 1
Level 1

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!

1 Accepted Solution

Accepted Solutions

dldresser
Level 1
Level 1

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

View solution in original post

3 Replies 3

Quigath
Spotlight
Spotlight

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]\

smeegada1
Spotlight
Spotlight

Driver name changed from 11.0 to 11.6.Have you changed it accordingly in context.xml

dldresser
Level 1
Level 1

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