Exporting Voting Results

Voting service has the support for exporting voting results to external data storage.

The contents of this topic:

 

Exporting to file

SMS Studio writes the complete set of voting results to the file specified by the user.

The file is overwritten each time an export occurs. The external application, which reads the file, should be aware that it will not be able to access the file at the short period of times when the file is being updated.

The voting results are written in the form of tab-delimited text table. Each line in the text file includes the following data:

At the time of exporting, the whole set of voting results is written to the file. To allow external applications to learn the time when the update has been completed, SMS Studio assigns a TimeID value to all the records in the set. The TimeID value contains the time in the following form: yyyyMMddHHmmss.

 

Exporting to database

SMS Studio writes the complete set of voting results to the table specified by the user.

At the time of exporting, the whole set of voting results is written to the table. To allow external applications to distinguish between different sets of voting results, SMS Studio assigns a unique TimeID value to all the records in one set. The TimeID value contains the time at which the set has been exported in the following form: yyyyMMddHHmmss.

The table for voting results should have the following fields:

Once the set is written to the database, SMS Studio updates the Status table. This table keeps the record of the last completely written set in the voting results table. The Status table should have the following fields:

For example, if a table used for exporting is named Voting, the proper reading of the latest voting results would be like this:

SELECT Answer, Votes
FROM Voting
WHERE TimeID = ( SELECT LastTimeID
                 FROM Status
                 WHERE TableName = 'Voting' )

 

Voting Setup dialog - Export tab

Exporting options

ODBC Data Source

Text file

 

Copyright © 2002-2007 CodeSegment. All rights reserved.

   www.codesegment.com