Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Trying to use COPY FILE in a Job
Sun, Oct 7 2018 12:51 PMPermanent Link

Jan Ferguson

Data Software Solutions, Inc.

Team Elevate Team Elevate

I'm trying to use COPY FILE in a Job (as shown below towards the end, pointed to by the arrows). I have been using this Job (without the COPY FILE command) for a LONG while and it works perfectly. When I add the COPY FILE to the Job I get the following error:
"ElevateDB Error #700 An error was found in the statement at line 19 and column 6 (Expected : but instead found FILE)"

Can't I use COPY FILE in a Job? How can I accomplish copying a "EDBUpd" file, after it's created, to a physical directory on the remote machine?

Thanks in advance,
Jan


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';

COPY FILE DBName + ".EDBUpd" IN STORE "Backups"             <------------
TO DBName".EDBUpd" IN STORE "Backups-Remote"                  <-----------

END IF;
FETCH NEXT FROM DBCursor ('Name') INTO DBName;
END WHILE;
CLOSE DBCursor;
END
Sun, Oct 7 2018 1:05 PMPermanent Link

Jan Ferguson

Data Software Solutions, Inc.

Team Elevate Team Elevate

Disregard my post. Brain must've gone dead. I forgot to include EXECUTE IMMEDIATE if front of the COPY FILE command. It's working now.

Jan


Jan Ferguson wrote:

Can't I use COPY FILE in a Job? How can I accomplish copying a "EDBUpd" file, after it's created, to a physical directory on the remote machine?
Image