Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 SQL Manual » DDL Statements » ALTER JOB |
ALTER JOB <Name> RUN AS <UserName> FROM <StartDate> TO <EndDate> <IntervalDefinition> [CATEGORY <CategoryName>] <BodyDefinition> [DESCRIPTION <Description>] [VERSION <VersionNumber>] [ATTRIBUTES <CustomAttributes>] <BodyDefinition> = BEGIN [<Declaration>;] [<Declaration>;] [<Statement>;] [<Statement>;] [EXCEPTION [<Statement>;]] END <IntervalDefinition> = <IntervalType>|<SpecificInterval> <IntervalType> = ONCE|HOURLY|DAILY|WEEKLY|MONTHLY|AT SERVER START [ON <DaysDefinition>|ON <DaysDefinition> OF <MonthsDefinition> BETWEEN <StartTime> AND <EndTime>] <SpecificInterval> = EVERY <Interval> MINUTES|HOURS|DAYS|WEEKS ON <DaysDefinition> BETWEEN <StartTime> AND <EndTime> HOURLY/DAILY/WEEKLY/EVERY <Interval> MINUTES/HOURS/WEEKS Interval <DaysDefinition> = [MON] [,TUE] [,WED].... MONTHLY Interval <DaysDefinition> = DAY <DayNumber>| FIRST|SECOND|THIRD|FOURTH|LAST MON|TUE|WED|THU|FRI|SAT|SUN <DayNumber> = 1..31 <MonthsDefinition> = [JAN] [,FEB] [,MAR] [,APR]...
-- The following statement changes the run time -- of the Backup job. ALTER JOB Backup RUN AS "System" FROM DATE '2006-01-01' TO DATE '2010-12-31' DAILY BETWEEN TIME '12:00 AM' AND TIME '12:30 AM' CATEGORY 'Backup' BEGIN DECLARE DBCursor CURSOR FOR DBStmt; DECLARE DBName VARCHAR DEFAULT ''; PREPARE DBStmt FROM 'SELECT * FROM Databases'; OPEN DBCursor; FETCH FIRST FROM DBCursor ('Name') INTO DBName; WHILE NOT EOF(DBCursor) DO IF (DBName <> 'Configuration') THEN EXECUTE IMMEDIATE 'BACKUP DATABASE "' + DBName + '" AS "' + CAST(CURRENT_DATE AS VARCHAR(10)) + '-' + DBName + '" TO STORE "Backups" INCLUDE CATALOG'; END IF; FETCH NEXT FROM DBCursor ('Name') INTO DBName; END WHILE; CLOSE DBCursor; END
Deviation | Details |
Extension | This SQL statement is an ElevateDB extension. |
This web page was last updated on Thursday, November 16, 2023 at 10:39 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |