Focal Point
Report trigger question.....

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2641067331

September 29, 2003, 10:57 AM
<Rob M>
Report trigger question.....
Wondered if it is possible to have some kind of 'trigger' to run a report and deliver via reportcaster?

Basically we have an integration database that puts data between two sql databases. This database has a 'failure' table which capture data that has not been integrated correctly in accordance with the rules defined. What I would like to do is when a new line of data is entered in the failure table then a webFOCUS report will automatically run and will be sent to a specific user./

Any ideas how best to approach this?
September 30, 2003, 07:39 AM
<Grzegorz>
It seems that you are asking about the standard MRE/ReportCaster functionality - alert scheduling.
Look at the manuals: Managed Reporting Administrator (creating alerts), and Report Caster Administrator (scheduling alerts).
You can also create alerts in FEX, something like this:
-*
TABLE FILE failure_table
PRINT *
WHERE READLIMIT EQ 1
WHERE new_data_in_the_table_check_expression
ON TABLE HOLD
END
-IF &RECORDS EQ 0 THEN GOTO :FINISH;
-INCLUDE the_report
-:FINISH
-*
Then schedule the report as standard report within Report Caster.
(The similar technique is used by the MRE alert wizard.)

Hope this helps
Grzegorz
September 30, 2003, 01:37 PM
Susan Trommer
The ReportCaster Alert feature is definitely an option but if the table already contains records, the table would have to contain some field (column) for which the WHERE could be built to test for a criteria that would fulfill your assessment needs.
Another option to look into is to add a trigger to the exception table that when a record is added it makes a call and runs an OS level program (Java Application) that utilizes the ReportCaster BEAN API (supported on all platforms that support Java).
You would have a schedule created to run the report against the execution table and make that schedule inactive. Then the Java application that uses the Bean API would pass either the schedule ID or the description of the schedule to run the schedule when a record is added to the exception table.
I don't have a sample or any information on how to setup a SQL database trigger to call the OS. You would have to investigate this in the vendor doc for the DBMS itself.
Good Luck!