| Reporting on information > Running a report > Monitoring reports using SQL > Using SQL statements to monitor Report Package report

Using SQL statements to monitor Report Package report

The administrator can use simple SQL statements against the task table to find out which Report Package reports Chancery SMS is processing [see also How Chancery SMS processes Report Package reports in the task table >>].

The following sample SQL scripts illustrate how to find reports in the task table. By adding more qualifiers to such scripts, the administrator can conduct very specific searches.

To show all reports—scheduled, recurring, or actively running:

select * from CSL_SS_TASK (NOLOCK)
where (TARGET_MACHINE_TYPE = 32 or TARGET_MACHINE_TYPE=256)

To show all actively generating (running) reports on the system (one time, scheduled, or recurring) at this point in time:

select * from CSL_SS_TASK (NOLOCK)

where (TARGET_MACHINE_TYPE = 32 or TARGET_MACHINE_TYPE=256 and STATUS=4)

To show all reports that are set up on a recurring schedule:

select * from CSL_SS_TASK (NOLOCK)

where (TARGET_MACHINE_TYPE = 32 or TARGET_MACHINE_TYPE=256) and RECURRENCE_TYPE<>0

When creating useful SQL statements, the administrator might find it useful to refer to the following columns in the CSL_SS_TASK table:

= TYPE: A description of the task, for example "Report/Export Execution Task" for reports and exports.
= OWNER_USER_ID: Where applicable, the User ID (login name) and User Role ID of the user generating the task. No value indicates a system-generated task.
= DESCRIPTION: Additional information regarding the task. If the task is a report, it will include the report name, for example, "Executing Student Absences and Tardiness by Grade...".
= RECURRENCE_TYPE: The type of recurrence method used.

0 - Not a recurring task

1 - Recurring in Minutes

2 - Recurring in Hours

3 - Recurring in Days

4 - Recurring in Weeks

5 - Recurring in Months

= RECURRENCE_INTERVAL: Increment of the recurrence_Type value set, for example, if the Recurrence_Type is set to 2 and the Recurrence_interval is set to 32, the task will repeat every 3 hours.
= LAST_RECURRED_ON: The last data and time the task was run, if it is a recurring task. If the task is not recurring or has not yet been executed, the value will show as 1/0/1900 0:00.
= STATUS: The current status of the task. The values are:

NULL - N/A

2 - Not Started

3 - Completed

4 - Running

5 - Retrying

6 - Failed

= TARGET_MACHINE_TYPE: This applies to which type of Chancery SMS server the task is intended to run on. The acceptable values are:

4 - Directory Services

8 - Database

16 - Web

32 - Reports

64 - Gradebook

128 - Scheduling

256 - Reports (light)

512 - Application

= TARGET_MACHINE: If the task is in progress, this will show you the specific server that is fulfilling the job.
= LAST_ENDED_ON: The last date and time the task was completed. If the task is not recurring or it has not yet been executed, the value will show as 1/0/1900 0:00.
= LAST_STARTED_ON: The last date and time the task was started. If the task has not started, the value will show as 1/0/1900 0:00.

How Chancery SMS processes Report Package reports in the task table

The CSL_SS_TASK table contains a list of all scheduled and running tasks. Since Chancery SMS treats a Report Package report as a task, it appears in the table when the report is set to run immediately, at a specified time, or on a recurring schedule.

The following examples illustrate how Chancery SMS processes a Report Package report through the CSL_SS_TASK table.

A. Chancery SMS executes a "Run now" report:

1 A task is created in the CSL_SS_TASK table to run the report.
2 A Chancery SMS Application Server specified to run reports picks up the task and generates the report. The task is still visible in the CSL_SS_TASK table.
3 The Crystal Reports engine requests data from Chancery SMS.
4 When Chancery SMS hands the required data successfully to the Crystal Reports engine, the task is deleted from the CSL_SS_TASK table.
5 The Crystal Reports engine generates the report and the report is returned to the user.

B. Chancery SMS executes a ‘Run now' report and the browser window for the report is closed before the report is returned to the user:

1 A task is created in the CSL_SS_TASK table to run the report.
2 A Chancery SMS Application Server specified to run reports picks up the task and generates the report. The task is still visible in the CSL_SS_TASK table.
3 The Crystal Reports engine requests data from Chancery SMS.
4 When Chancery SMS hands the required data successfully to the Crystal Reports engine, the task is deleted from the CSL_SS_TASK table.
5 The Crystal Reports engine generates the report and a link to the report is found on the user's home page under Schedule Events - Reports.
= After viewing and/or saving the report, the user should delete the item from the page.

C. Chancery SMS executes a "One time" report at a scheduled time and date:

1 A task is created in the CSL_SS_TASK table to run the report.
2 At the scheduled date and time, a Chancery SMS Application Server specified to run reports picks up the task and generates the report. The task is still visible in the CSL_SS_TASK table.
3 The Crystal Reports engine requests data from Chancery SMS.
4 When Chancery SMS hands the required data successfully to the Crystal Reports engine, the task is deleted from the CSL_SS_TASK table.
5 The Crystal Reports engine generates the report and a link to the report is found on the user's home page under Scheduled Events - Reports.
= After viewing and/or saving the report, the user should delete the item from the page.

D. Chancery SMS executes a "recurring" report at a scheduled start time, start date, and interval (for example, every three hours starting on Jan 4 at 10:45am):

1 A task is created in the CSL_SS_TASK table to run the report.
2 At the schedule date, time, and interval, a Chancery SMS Application Server specified to run reports picks up the task and generates the report. The task is still visible in the CSL_SS_TASK table.
3 The Crystal Reports engine requests data from Chancery SMS.
4 When Chancery SMS hands the required data successfully to the Crystal Reports engine, the task is not deleted from the CSL_SS_TASK table.
5 The Crystal Reports engine generates the report and a link to the report is found on the user's home page under Schedule Events - Reports.
6 The task is still visible in the CSL_SS_TASK table.
= In this scenario, the task is only deleted from the CSL_SS_TASK table if the user who created the recurring report schedule deletes the report schedule from his or her home page under Scheduled Events - Reports.

Pearson
Always Learning
www.pearsonschoolsystems.com 
Tel: 866-434-6276
Email: psstechsupp@pearson.com