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-13-2012 09:42 AM
Hi,
Please refer the section "DB Write Step" on page 202 onwards in the below document,
Hope it helps,
Anand
Please rate helpful posts..
02-13-2012 10:37 AM
Some quick advice, check formatting(especially spaces) and use variables. Try just the INSERT command first, then just the DELETE command and see which is broken.
DELETE FROM [Samsung-DK] WHERE Question1 = 150
INSERT INTO Samsung-DK(Question1) VALUES ($Var1)
-store 200 in variable Var1
02-13-2012 11:41 PM
Thank you, Raymon!
Your advise partially helped. Now I'm using following syntax:
INSERT INTO [Samsung-DK](Question1) VALUES ($Var1)
That is weard, it works in "Test" tab, but uploading script to CCX server this command does nothing. Do you have any clues?
02-23-2012 04:54 AM
Hi everyone!
I have found that was the problem and a solution for this. Decided to post solution here, just in case someone will experience the same.
The problem was that CCX Script editor can't interconnect different SQL version syntax. On the server, running CCX, I have MS SQL Server 2000, but on the server, running data base, MS SQL Server 2008 is installed. That is interesting, adding ODBC object successed through Administration Tools, but running SQL through scripts reverted to SQL error.
Solution is to install ODBC driver for SQL 2008, create new ODBC object with this driver and everything works with no problems.
01-02-2013 04:09 AM
Hi Andrejs and others,
Can you please elaborate the steps that how you create DSN and use DB Steps? as we are facing Issue in creating DSN that is required in DB Steps.
Our requirement is as under:
> We have to use DB Write component to log IP IVR related data in custom created tables.
In my previous experience with UCCX 6.5/7, on Windows 2000 server and SQL Server, I easily created DSN (using App Admin) that was then available in DB Tools of CRS Editor.
Kindly help, with UCCX 8.5.1 on Linux and Informix Server, how can I use DB Write tool to use SQL Insert Command.
Kindly note that we have created custom Tables successfully.
Your prompt reply will help us to go forward.
Regards
Kashif Surhio
01-02-2013 06:57 AM
Hi,
you don't need to change anything in your UCCX scripts, DB write should work fine, unless you use a really exotic, version-specific SQL syntax.
On UCCX 8.5.1, you don't use DSN's. You have to download the JTDS JDBC driver (
http://sourceforge.net/projects/jtds/files/) and upload it to the UCCX using the appadmin web interface.
G.
01-31-2013 04:48 AM
Hi Gergely
UCCX veriosn 8.5(1)
We want to write/ insert the data from script editor using DBWrite method, We have created the DSN to the external database, external database is Oracle 10g, the connection is successfully established and tested from Cisco UCCX Datasource web page. But when we write the Insert statement into the script there is no sysntax error, but the data is not inserted into the database, when we test the query it said 0 rows affedted, we build the query and its syntax is correct as editor save the script successfully. In the database the data is not inserted, but when we delete the data through script editor it says 1 row afftected, so i am confused why data is not inserted into the database table.
Kindly let us know what to do and how to investigate further.
Regards
Adeel Aslam
01-31-2013 04:51 AM
Hi,
the test function of the DB Write step does not actually write.
Did you try running your script in reactive debugging mode?
Also, please do post your SQL statement - might be a problem with it. And a screenshot of the relevant parts of the DB Write step.
G.
01-31-2013 05:07 AM
Hi Gergely
Thanks for your prompt reply.
1. Insert Query
INSERT INTO BALANCEINQUIRY (NEWID) VALUES('3')
2. Yes, trying to run the script in the debugging mode and there is no error.
3. At this time i am unable to send you the screen shot,
Kindly let me know if i am missing anything.
Regards
Adeel Aslam
01-31-2013 05:48 AM
What is the data type of BALANCEINQUIRY.NEWID? Is it VARCHAR or INT?
G.
01-31-2013 05:51 AM
Hi Gergely
We are using Oracle its Number Type
01-31-2013 05:53 AM
And if you try
INSERT INTO BALANCEINQUIRY (NEWID) VALUES(3)
?
01-31-2013 05:55 AM
Same result. record not inserted into table
01-31-2013 05:57 AM
Alright, can you enable the traces for the database subsystem and database steps, retry the query and then observe the output of catalina.out ?
G.
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