Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

assigning SQL date/time value to variable in IVR script

I am trying to pull a sql date/time value from a Microsoft SQL 2000 database and assign the value to a local variable in an IP IVR script.  I have tried creating both Date and Time variables however when I try to assign the value with DB Get Resource neither one shows up in the drop down menu in CCX script editor.  Do I need to do some data conversion with constructors or such?  Basically what I am trying to do is compare the current date and time to a date and time stored in a database.

Everyone's tags (1)
5 REPLIES
Green

Re: assigning SQL date/time value to variable in IVR script

Please do a search on this. I know it's come up a few times.

Regards,

Geoff

New Member

Re: assigning SQL date/time value to variable in IVR script

That was the first thing I did however I did not find anything relevant to this situation.  I will however continue to look in the mean time.  Thanks.

Green

Re: assigning SQL date/time value to variable in IVR script

That was the first thing I did however I did not find anything relevant to this situation.

I did a quick search - nothing exhaustive - and ..

https://supportforums.cisco.com/message/1030377#1030377

I am saying that this question is fairly common - as you would expect. Everyone who queries a database wants to do something like this.

Regards,

Geoff

New Member

Re: assigning SQL date/time value to variable in IVR script

I figured out the problem.  For those who want to know, when in UCCX Editor you can click on Add New Variable.  When the pop up box appears select any of the available variable types in the list.  We will change this in a moment.  Once you have selected a variable type it will be highlighed in blue.  Go ahead and type in the type of variable you need, in my case it was a java.sql.Timestamp.  I then named it databaseDate and left it at the default value.  Now when i do a database dip I can directly assign the value from the database to the newly created java.sql.Timestamp variable databaseDate.  To compare my database date to the current date I created a new variable of type Date and called it currentDate with a value of new Date().  You can do a direct comparison of type Date with java.sql.Timestamp such as "if (currentDate <= databaseData).  Hope this helps.

Green

Re: assigning SQL date/time value to variable in IVR script

Exactly. It's not that obvious how to change the type of a variable in Expression Editor, but once you know, you don't forget.

Thanks for the summary. Points deserved and points awarded.

Regards,

Geoff

1855
Views
10
Helpful
5
Replies