Jump to content


< Back to Forum


 

Create Dynamically Sound File Name


  • Please log in to reply

#1 akarast 15 May 2015 - 07:36 AM

I want to create audio files dynamically based on the query results. Database Query module as follows:

SELECT time_ref FROM restourant WHERE restourant_code=$RV[GET RESTOURANT CODE] and reservation_status=0 and min_pax<=$RV[GET RESERVATION COUNT] and max_pax>=$RV[GET RESERVATION COUNT]

Query results (time_ref variable) can be between 1 and 7. Query may return multiple data. Play Module will change according the query results. Of course, I do not know the number of records returned.

For example;

Only one record return, time_ref variable = "3",  sound file to play = "\time_3.wav"

Two record return, time_ref variable = "4" and "5",  sound file to play = "\time_4.wav,\time_5.wav"

four record return, time_ref variable = "1","3","6" and "7",  sound file to play = "\time_1.wav,\time_3.wav,\time_6.wav,\time_7.wav"

 

Please help me. Is it possible to make in Evaluate Expression module?

 

I've got another question. Can I use "group by" function in Database Query Module?

Thank you.



#2 SupportTeam 15 May 2015 - 07:54 PM

The following Result Variable can be used to access the number of database entries which were returned:

 

$RV[ModuleTitle_RowCount]

 

The results of the database query are accessible using Result Variables. The following Result Variables can be used to access data retrieved by a Db Query module:

$RV[ModuleTitle_ColumnIndex_RowIndex]

If more then one item was requested in the query, the Column Index can be used to access the individual items in each retrieved row.

eg: module LookupTelFax uses a query: SELECT Tel, Fax FROM Customer WHERE CustId='$RV[Get CustId]'
We can use $RV[LookupTelFax_1_1] to access the contents of the Tel column, and use $RV[LookupTelFax_2_1] to access he contents of the Fax column for customer 1.
$RV[LookupTelFax_1_2] can be used to access the contents of the Tel column for customer 2, etc.

 

More information can be found here: http://www.voiceguid.../moddbquery.htm

 

 

Approach would be to either set up a loop that adds new .WAV files to the string to be played, or just have separate Play modules with a different number of WAV entries depending on what is the value of the _RowCout variable

 

 

 

You should be able to use "group by" function in Database Query Module. The SQL expression is passed to the database, so if database supports it then it should be fine.



#3 SupportTeam 16 May 2015 - 02:08 PM

Please see attached the sample script demonstrating both approaches.

 

Please let us know if you have any questions.