VoiceGuide IVR Software Main Page
Jump to content

Firing Query Through Vb Script

Recommended Posts

i am willing to fire condition SQL statement base on selection.

As i have option asking user to input

1 for House building Advance

2 for Motar Car Advance

3 for Computer Advance

 

if User press 1 then Query will be

select Feild1, Feild2 from mytable where ab='$Rv[idNumber]' and advancetype='MCA'

if User press 2 then Query will be

select Feild1, Feild2 from mytable where ab='$Rv[idNumber]' and advancetype='MCA'

if User press 3 then Query will be

select Feild1, Feild2 from mytable where ab='$Rv[idNumber]' and advancetype='COM'

 

and so on...

 

how can i use script and pass value to module for query as flow after the query is same.

 

Please help me.

Share this post


Link to post

Are you asking how to set the $RV[idNumber] variable beforehand?

 

The variable is created automatically by any module that accepts user input (eg. Get Number and Play modules). You can also create the RV's from within a Evaluate Expression module and from within a Run VBScript modules etc.

 

Please read: http://www.voiceguide.com/vghelp/source/ht...ltvariables.htm

 

If you still have problems please post your current script.

Share this post


Link to post
Are you asking how to set the $RV[idNumber] variable beforehand?

 

The variable is created automatically by any module that accepts user input (eg. Get Number and Play modules). You can also create the RV's from within a Evaluate Expression module and from within a Run VBScript modules etc.

 

Please read: http://www.voiceguide.com/vghelp/source/ht...ltvariables.htm

 

If you still have problems please post your current script.

 

I have tried but unable to do. I am facing 2 problem .

One is of Vbscript based on user input.

Secand is in current IVR Script

my loop is working fine(Setloop Module) but i am facing problem if record are less then the loop and how to get out of loop as max time for loop to play is defined but how to restrict through database records.

 

Please help me as allways.

 

Thanks

employees.vgs

Share this post


Link to post
One is of Vbscript based on user input.

In the attached file have a look how the module [LoanType] is using $RV[Get Loan to Play] as part of the select case expression. Does this answer your question?

 

my loop is working fine(Setloop Module) but i am facing problem if record are less then the loop and how to get out of loop as max time for loop to play is defined but how to restrict through database records.

 

You need to use an Evaluate Expression module which compares the value of your counter variable ($RV[rec]) to the value of the number of rows retrieved by the DBQuery module [monthtrans].

The expression would need to be something like this:

 

$RV[rec] > $RV[monthtrans_RowCount]

 

If the expression is true then that means that the counter is more then the number of rows retrieved.

 

Share this post


Link to post
One is of Vbscript based on user input.

In the attached file have a look how the module [LoanType] is using $RV[Get Loan to Play] as part of the select case expression. Does this answer your question?

 

my loop is working fine(Setloop Module) but i am facing problem if record are less then the loop and how to get out of loop as max time for loop to play is defined but how to restrict through database records.

 

You need to use an Evaluate Expression module which compares the value of your counter variable ($RV[rec]) to the value of the number of rows retrieved by the DBQuery module [monthtrans].

The expression would need to be something like this:

 

$RV[rec] > $RV[monthtrans_RowCount]

 

If the expression is true then that means that the counter is more then the number of rows retrieved.

 

Sorry! may be you forgot to attachment.

 

Share this post


Link to post

There was no attachment in our previous post, just a suggestion what module you should add to your script to let the script check that the counter has reached the _RowCount level.

 

It's best for you to decide in what part of the script that module should be added.

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×