Return an alter script DDL between revisions or environments.


data : "-- *************************************** SqlDBM: Snowflake **************************************\r\n-- * Generated by SqlDBM: API. Test SF project, v17 vs v6 by [email protected]  *\r\n\r\nALTER FILE FORMAT fileformat SET\r\n    TYPE = CSV\r\n    COMPRESSION = AUTO\r\n    RECORD_DELIMITER = '\\r\\n'\r\n    FIELD_DELIMITER = ','\r\n    SKIP_HEADER = 0\r\n    DATE_FORMAT = 'AUTO'\r\n    TIME_FORMAT = 'AUTO'\r\n    TIMESTAMP_FORMAT = 'AUTO'\r\n    BINARY_FORMAT = HEX\r\n    ESCAPE = 'NONE'\r\n    ESCAPE_UNENCLOSED_FIELD = '\\\\'\r\n    TRIM_SPACE = FALSE\r\n    FIELD_OPTIONALLY_ENCLOSED_BY = 'NONE'\r\n    NULL_IF = ( '\\\\N' )\r\n    ERROR_ON_COLUMN_COUNT_MISMATCH = TRUE\r\n    VALIDATE_UTF8 = TRUE\r\n    EMPTY_FIELD_AS_NULL = TRUE\r\n    SKIP_BYTE_ORDER_MARK = TRUE\r\n    ENCODING = 'UTF8';\r\n\r\nALTER TABLE dbo.employee\r\n    SET STAGE_FILE_FORMAT = (\r\n        FORMAT_NAME = 'fileformat'\r\n    );\r\n\r\nALTER TABLE dbo.employee\r\n    SET STAGE_COPY_OPTIONS = (\r\n        ON_ERROR = ABORT_STATEMENT\r\n    );\r\n\r\nALTER TABLE dbo.employee\r\n    SET COMMENT = 'test table';\r\n\r\nALTER TABLE dbo.department\r\n    SET STAGE_FILE_FORMAT = (\r\n        FORMAT_NAME = 'fileformat'\r\n    );\r\n\r\nALTER TABLE dbo.department\r\n    ADD CONSTRAINT AK_4 UNIQUE (employee_id);\r\n\r\nCREATE VIEW dbo.view_employee\r\n\r\n  Comment = 'No Comment Provided'\r\n\r\nAS\r\n(\r\nselect * from dbo.employee\r\n\r\n);\r\n\r\nCREATE FUNCTION udf_echo_varchar(x varchar)\r\nreturns varchar\r\nlanguage java\r\ncalled on null input\r\nhandler='TestFunc.echoVarchar'\r\ntarget_path='@~/testfunc.jar'\r\nas\r\n'class TestFunc {\r\n  public static String echoVarchar(String x) {\r\n    return x;\r\n  }\r\n}';\r\n\r\nCREATE PROCEDURE proc()\r\n  RETURNS VARCHAR\r\n  LANGUAGE javascript\r\n  AS\r\n  $$\r\n  var rs = snowflake.execute( { sqlText: \r\n      `INSERT INTO table1 (\"column 1\") \r\n           SELECT 'value 1' AS \"column 1\" ;`\r\n       } );\r\n  return 'Done.';\r\n  $$;\r\n\r\nALTER TABLE dbo.department\r\n    CLUSTER BY ( department_number, employee_id );"
Click Try It! to start a request and see the response here!