--MARS-770

set verify off
SET serveroutput ON
--SET TIMING ON
whenever sqlerror exit sql.sqlcode rollback;

column owner format a15
column object_name format a30
column spoolname new_value spoolname 

select 'install_package_MarsGeneralRelease_templates_' || name || '_' ||to_char(sysdate,'YYYYMMDD_HH24MISS')||'.log' spoolname from v$pdbs;
spool '&spoolname'


prompt ##### started at time #####
select systimestamp from dual;
prompt ##### database name #####
select name pdb_name from v$pdbs;

--set echo on
--=============================================================================================================================
-- start install --MARS-770 payload
--=============================================================================================================================

CREATE USER CT_ET_TEMPLATES IDENTIFIED BY "afa3343DDD___"
DEFAULT TABLESPACE DATA;

--DROP TABLE CT_ET_TEMPLATES.IDS_DATA;
CREATE TABLE CT_ET_TEMPLATES.IDS_DATA(
"STATION" VARCHAR2(2000),
"DATE" VARCHAR2(2000),
"LATITUDE" VARCHAR2(2000),
"LONGITUDE" VARCHAR2(2000),
"ELEVATION" VARCHAR2(2000),
"NAME" VARCHAR2(2000),
"TEMP" VARCHAR2(2000),
"TEMP_ATTRIBUTES" VARCHAR2(2000),
"DEWP" VARCHAR2(2000),
"DEWP_ATTRIBUTES" VARCHAR2(2000),
"SLP" VARCHAR2(2000),
"SLP_ATTRIBUTES" VARCHAR2(2000),
"STP" VARCHAR2(2000),
"STP_ATTRIBUTES" VARCHAR2(2000),
"VISIB" VARCHAR2(2000),
"VISIB_ATTRIBUTES" VARCHAR2(2000),
"WDSP" VARCHAR2(2000),
"WDSP_ATTRIBUTES" VARCHAR2(2000),
"MXSPD" VARCHAR2(2000),
"GUST" VARCHAR2(2000),
"MAX" VARCHAR2(2000),
"MAX_ATTRIBUTES" VARCHAR2(2000),
"MIN" VARCHAR2(2000),
"MIN_ATTRIBUTES" VARCHAR2(2000),
"PRCP" VARCHAR2(2000),
"PRCP_ATTRIBUTES" VARCHAR2(2000),
"SNDP" VARCHAR2(2000),
"FRSHTT"  VARCHAR2(2000)
);