Created
April 14, 2016 01:08
-
-
Save prb112/279ba1b5091d4ac990e30eda2e890082 to your computer and use it in GitHub Desktop.
This file contains 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
CREATE COMPUTE MODULE CreateData_Compute | |
CREATE FUNCTION Main() RETURNS BOOLEAN | |
BEGIN | |
DECLARE Source CHARACTER 'Production' ; | |
DECLARE DBSchema CHARACTER 'DB2ADMIN'; | |
DECLARE Table CHARACTER 'EMPLOYEE'; | |
SET OutputRoot = InputRoot; | |
DECLARE EMPNO1 REFERENCE TO InputRoot.JSON.Data.EMPNO; | |
DECLARE FIRSTNME1 REFERENCE TO InputRoot.JSON.Data.FIRSTNME; | |
DECLARE LASTNAME1 REFERENCE TO InputRoot.JSON.Data.LASTNAME; | |
DECLARE JOB1 REFERENCE TO InputRoot.JSON.Data.JOB; | |
DECLARE EDLEVEL1 REFERENCE TO InputRoot.JSON.Data.EDLEVEL; | |
INSERT INTO Database.EMPLOYEE (EMPNO, FIRSTNME, LASTNAME, JOB, EDLEVEL) | |
VALUES (EMPNO1, FIRSTNME1, LASTNAME1, JOB1, EDLEVEL1); | |
-- Set the Repsonse Here | |
-- you can modify the initial message, or create a new object | |
CREATE FIELD OutputRoot.JSON.Data.SUCCESS TYPE NameValue Value ''; | |
SET OutputRoot.JSON.Data.SUCCESS = 'Details of Success Are Here'; | |
PROPAGATE; | |
RETURN TRUE; | |
END; | |
END MODULE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment