![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Incident Reports » Incident Reports Reported for Version 2.01 » View Incident Report |
![]() |
Reported By: Roy Lambert Reported On: 7/24/2008 For: Version 2.01 Build 1 |
SCRIPT(IN USERID VARCHAR) BEGIN DECLARE SQLStatement VARCHAR; DECLARE InfoCursor SENSITIVE CURSOR FOR InfoStmt; DECLARE ResultCursor SENSITIVE CURSOR FOR ResultStmt; set status message to 'starting'; PREPARE InfoStmt FROM 'SELECT * FROM Information.Tables WHERE Name = ''emCounts'''; OPEN InfoCursor; IF (ROWCOUNT(InfoCursor) > 0) THEN EXECUTE IMMEDIATE 'DROP TABLE emCounts'; END IF; CLOSE InfoCursor; SET SQLStatement = 'CREATE TABLE emCounts AS SELECT _BoxNo , _BoxName, (SELECT COUNT(_fkMailBoxes) from "$Disk".EMails WHERE _fkMailBoxes = MailBoxes._Boxno AND (EMails._Private = FALSE OR EMails._fkUsers = '''+USERID+ ''')) AS _OnFile , (SELECT COUNT(_fkMailBoxes) from "$Disk".emReadStatus WHERE _fkUsers = '''+USERID+ ''' AND _fkMailboxes = MailBoxes._Boxno) AS _Read, 0 AS _Unread FROM "$Disk".MailBoxes WHERE _Monitored = TRUE WITH DATA'; PREPARE ResultStmt FROM SQLStatement; EXECUTE ResultStmt USING USERID, USERID; EXECUTE IMMEDIATE 'UPDATE emCounts SET _Unread = _OnFile - _Read'; EXECUTE IMMEDIATE 'CREATE INDEX PK ON emCounts (_BoxNo)'; set status message to 'done'; END procedure TEMailsForm.RecountStatusMessage(Sender: TObject; const StatusMessage: string); begin showmessage(statusmessage); end;
This web page was last updated on Wednesday, October 30, 2024 at 11:41 AM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |