Skip to content

Instantly share code, notes, and snippets.

@phpdave
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpdave/71084e681d31becd0875 to your computer and use it in GitHub Desktop.
Save phpdave/71084e681d31becd0875 to your computer and use it in GitHub Desktop.
--::REMOVED:: Can only use IF statement in a Stored Procedure
--If no SCRAPNEW Library create one w/ current user profile
--IF (NOT EXISTS(SELECT * FROM TABLE(SYSIBM.SCHEMAS()) AS SCHEMAS WHERE ODOBNM='SCRAPNEW')) THEN
-- CREATE SCHEMA SCRAPNEW;
--END IF;
/* Creating table SCRAPNEW.CUSTOMERS */
CREATE TABLE SCRAPNEW.CUSTOMERS (
ID BIGINT GENERATED ALWAYS AS IDENTITY (
START WITH 1, INCREMENT BY 1,
NO ORDER, NO CYCLE, NO MINVALUE,
NO MAXVALUE, CACHE 20),
NAME VARCHAR (50),
ADDRESS VARCHAR (50),
CITY VARCHAR (50),
STATE VARCHAR (2),
ZIP INTEGER);
/* Setting label text for SCRAPNEW.CUSTOMERS */
LABEL ON TABLE SCRAPNEW.CUSTOMERS IS 'Customer Table' ;
/* Setting column labels for SCRAPNEW.CUSTOMERS */
LABEL ON COLUMN SCRAPNEW.CUSTOMERS (
ID TEXT IS 'Autogenerated ID' ,
NAME TEXT IS 'Name of customer' ,
ADDRESS TEXT IS 'Address of Customer' ,
CITY TEXT IS 'City of Customer' ,
STATE TEXT IS 'State abbrev. of Customer' ,
ZIP TEXT IS 'ZIP of Customer' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment