10-29-2009 05:38 AM - edited 03-14-2019 04:47 AM
Hi,
I am having issues with DB Get. Even after assigning the local variable in CRS script as "Date" type, I am unable to select it as a local variable in the "Add/Modify Button under the Filed Selection TAB.
The Filed type for this in SQL DB is DateTime.
Attached is the screenshot.
Can somebody suggest what is the issue?
10-29-2009 06:13 AM
Hi,
I ran into this situation before. The only way I could work around it, was to create a view in SQL, which takes the date and convert it to a String (ex: 20091029). So, instead of doing the request against the table, I'm doing it against the view.
After that, I'm able to retrieve the date as a String and convert it back to a date using the following Java code into a "SET" step:
Assume that you have a variable named "nDateFromSQL" of type String
{
SimpleDateFormat lFormatter = new SimpleDateFormat("yyyyMMdd");
nTrandate = lFormatter.parse(nDateFromSQL);
}
I hope that help !
10-29-2009 12:55 PM
Hi Sferland,
Thanks. I don't know Java and only little SQL.
The above Java code ?
1.Will the final query in DB Read look like this:
Select { your suggested Java code above) from
10-30-2009 07:41 AM
Hi,
Your query in "DB Read" should look exactly the same as today. Instead of doing the query on the table you're doing it on the view.
Ex:
Before:
SELECT * FROM
10-29-2009 10:44 PM
ok, thanks.
I am also facing an issue for e.g. the SQL filed type is smallint, the ivr variable I declare is of type int.
But when I do a DB get, the control reaches the SQL error branch.
I am not sure why is this so,,,
In the DBGET, the DB Get function declared desclared the data type as java.lang.integer.
Thanks
10-29-2009 11:06 PM
What exactly are you trying to accomplish?
I usually stay away from touching the DB direct. Can you ask your DB team if they can have a webservice its lot easier cleaner and saves you lot of pain in long run.
good luck.
Baseer.
10-29-2009 11:18 PM
Hi,
I am trying to read the value from customer SQL 2005 DB from another server in IVR local variables, which I have to announce to caller using create generated prompt. Hence I do DB Read first followed by DB Get.
Hence facing these issues. Can you help to suggest how to resolve.
Also can you elaborate about a web service, If I have to use this, what the customer has to do?
Thanks
10-29-2009 11:26 PM
Rajesh,
Your customer probably has this if not they have to setup a web page where you can go to the url and type post or get your desired input and output. Store this output to variable then announce it .
this can be done using getxml document etc.
Good luck.
Baseer.
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