02-12-2012 11:52 PM - edited 03-14-2019 09:21 AM
Hello all!
I am trying to write some data in external database from CCX script, but "DB Write" step always goes to "SQL Error" although I am using correct SQL syntax. I have checked it through MS SQL Management studio and everything works.
Interesting is the fact, that "DB Read" step works fine!!!
Another weard thing is that making test from "DB Write" step properties shows "Rows altered 1"...
Nearby is commands I am trying to execute with no success:
delete from [Samsung-DK] where Question1=150
and
insert into Samsung-DK(Question1) values (200)
I will very appreciate any help or advice, because I cannot find any clue in Cisco manuals.
Thank you in advance.
02-14-2013 08:38 AM
Hi,
there must be something wrong with your query - and I am sorry but I can't help you out here.
I set up a test system, and tried to replicate the problem, but I failed. When I used the following SQL statement:
INSERT INTO t1 (val1,val2) VALUES ($s_cnic,$val2)
UCCX did not have any problems with it, the values (two Strings) appeared in the database table).
G.
03-07-2013 10:38 PM
Hi Gergely
Thanks for your support and guidance. There was problem in my query and also the database table, we corrected this and now able to save the record in the database.
Regards
Adeel Aslam
02-14-2014 05:52 AM
Hi everybody,
for those people following this thread and having the same issue:
I have had it too and spent/waste some time on it!
It worked all the time!
Unfortunatetly, I trust the "test step" and this was my problem. Working with static values, the "test step" shows me the altered rows, but working with variable it does not, so I try and try and try!
So if you don't have any other error (like exception), try to run the script. The syntax is quite simple, it doesn't matter if you put the commands in one row or different, it will work.
My version of ccx is 8.5.1 and used with oracle 11.
Hope it will save some time.
Regards,
Heiko
11-24-2022 11:32 PM
Thanks dear @kleintz
your notes helped me a lot..
you are awesome my friend
Here's what I noticed:
when do test script with specific data (like '999'), the test will show success (it show some number in "Number of rows altered")
when do test script with variable data (like $CLID), the test not show anything (it show 0 number in "Number of rows altered")
but it is OK, don't worry,
save your script, Run it and make some calls,
script will work and your data will be written.. ( do some query on your database after that..)
05-07-2015 07:34 PM
Hi Adeel Aslam,
Can you please share what was the error in Query and in Database Table?
I'm also facing same issue.Im trying to insert below query but DB write steps always going to SQL error branch.
INSERT INTO CallSurveyDetails (CallDetailID,AgentID,SurveyStartTime,SurveyEndTime,Question1_Response,Question2_Response,ACS_Completed)
VALUES ('67476931050500',3744,'2015-05-07 14:27:00:000','2015-05-07 14:30:00:000',5,10,'ACS_Completed')
Thanks
Fakhrul Islam
11-24-2022 11:27 PM - edited 11-24-2022 11:29 PM
Hi dear @a_cvetkovs
if you want to write specific data, you must put your value between ' '
for exmaple:
INSERT INTO uccxdb.dbo.TABLE01 (CLID) VALUES ('999')
and if you want to write a variable data, you must put only $ before your variable
for example:
INSERT INTO uccxdb.dbo.TABLE01 (CLID) VALUES ($s_CLID)
very important note:
when do test script with specific data (like '999'), the test will show success (it show some number in "Number of rows altered")
when do test script with variable data (like $CLID), the test not show anything (it show 0 number in "Number of rows altered")
but it is OK, don't worry,
save your script, Run it and make some calls,
script will work and your data will be written.. ( do some query on your database after that..)
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