cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7147
Views
10
Helpful
35
Replies

DB Write Step Does Not Work in CCX Script Editor

a_cvetkovs
Level 1
Level 1

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.

35 Replies 35

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.

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

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

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..)


..if this (helps) or (answered your question), please click (Helpful) or (Accept as Solution)..

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

M Reza Hadi
Level 1
Level 1

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..)


..if this (helps) or (answered your question), please click (Helpful) or (Accept as Solution)..
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: