Forked from kingharrison/gist:68cc58243804e823f1de63cc185c31a1
Created
June 7, 2016 09:36
-
-
Save samsonasik/291f67bc762fbbd3bc5b424b001dc517 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF (NOT EXISTS(SELECT * FROM QSYS2.SYSTABLES WHERE TABLE_SCHEMA = 'BACKUP' AND TABLE_NAME='MYTABLE')) THEN | |
CREATE TABLE BACKUP.MYTABLE | |
AS (SELECT * FROM MYLIB.MYTABLE) | |
WITH DATA; | |
ELSE | |
INSERT INTO BACKUP.MYTABLE | |
SELECT * FROM MYLIB.MYTABLE; | |
END IF; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment