0% found this document useful (0 votes)
890 views4 pages

Create All Time Zone Tables in HANA Schema SYSTEM

The document provides SQL commands to: 1. Create time zone tables in the SYSTEM schema in HANA. 2. Insert data from existing time zone tables in another schema into the new tables in SYSTEM. 3. Update the client column value from 100 to 001 in the time zone tables in SYSTEM.

Uploaded by

Kapil Kulkarni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
890 views4 pages

Create All Time Zone Tables in HANA Schema SYSTEM

The document provides SQL commands to: 1. Create time zone tables in the SYSTEM schema in HANA. 2. Insert data from existing time zone tables in another schema into the new tables in SYSTEM. 3. Update the client column value from 100 to 001 in the time zone tables in SYSTEM.

Uploaded by

Kapil Kulkarni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Create all time zone tables in HANA schema "SYSTEM"

Create timezone tables in SYSTEM schema


Change "SAPPRD" to "SYSTEM"
CREATE COLUMN TABLE "SYSTEM"."TTZD" ("CLIENT" NVARCHAR(3) DEFAULT '000' NOT
NULL ,
"DSTRULE" NVARCHAR(6) DEFAULT '' NOT NULL ,
"DSTDIFF" NVARCHAR(6) DEFAULT '000000' NOT NULL ,
"FLAGACTIVE" NVARCHAR(1) DEFAULT '' NOT NULL ,
CONSTRAINT "TTZD~0" PRIMARY KEY ("CLIENT",
"DSTRULE")) UNLOAD PRIORITY 5 AUTO MERGE;
CREATE COLUMN TABLE "SYSTEM"."TTZDF" ("CLIENT" NVARCHAR(3) DEFAULT '000' NOT
NULL ,
"DSTRULE" NVARCHAR(6) DEFAULT '' NOT NULL ,
"YEARACT" NVARCHAR(4) DEFAULT '0000' NOT NULL ,
"DATEFROM" NVARCHAR(8) DEFAULT '00000000' NOT NULL ,
"TIMEFROM" NVARCHAR(6) DEFAULT '000000' NOT NULL ,
"DATETO" NVARCHAR(8) DEFAULT '00000000' NOT NULL ,
"TIMETO" NVARCHAR(6) DEFAULT '000000' NOT NULL ,
CONSTRAINT "TTZDF~0" PRIMARY KEY ("CLIENT",
"DSTRULE",
"YEARACT")) UNLOAD PRIORITY 5 AUTO MERGE;
CREATE COLUMN TABLE "SYSTEM"."TTZDV" ("CLIENT" NVARCHAR(3) DEFAULT '000' NOT
NULL ,
"DSTRULE" NVARCHAR(6) DEFAULT '' NOT NULL ,
"YEARFROM" NVARCHAR(4) DEFAULT '0000' NOT NULL ,
"MONTHFROM" NVARCHAR(2) DEFAULT '00' NOT NULL ,
"WEEKDFROM" NVARCHAR(1) DEFAULT '0' NOT NULL ,
"WEEKDCFROM" NVARCHAR(1) DEFAULT '0' NOT NULL ,
"TIMEFROM" NVARCHAR(6) DEFAULT '000000' NOT NULL ,
"MONTHTO" NVARCHAR(2) DEFAULT '00' NOT NULL ,
"WEEKDTO" NVARCHAR(1) DEFAULT '0' NOT NULL ,
"WEEKDCTO" NVARCHAR(1) DEFAULT '0' NOT NULL ,
"TIMETO" NVARCHAR(6) DEFAULT '000000' NOT NULL ,
CONSTRAINT "TTZDV~0" PRIMARY KEY ("CLIENT",
"DSTRULE",
"YEARFROM")) UNLOAD PRIORITY 5 AUTO MERGE;
CREATE COLUMN TABLE "SYSTEM"."TTZZ" ("CLIENT" NVARCHAR(3) DEFAULT '000' NOT
NULL ,
"TZONE" NVARCHAR(6) DEFAULT '' NOT NULL ,
"ZONERULE" NVARCHAR(6) DEFAULT '' NOT NULL ,
"DSTRULE" NVARCHAR(6) DEFAULT '' NOT NULL ,
"FLAGACTIVE" NVARCHAR(1) DEFAULT '' NOT NULL ,
CONSTRAINT "TTZZ~0" PRIMARY KEY ("CLIENT",
"TZONE")) UNLOAD PRIORITY 5 AUTO MERGE;

Execute the CREATE Statement by pressing F8

Fill all timezone tables in schema SYSTEM


insert into "SYSTEM"."TTZD"
select * from "SAPS4D"."TTZD"
where client = '100';
insert into "SYSTEM"."TTZDF"
select * from "SAPS4D"."TTZDF"
where client = '100';
insert into "SYSTEM"."TTZDV"
select * from "SAPS4D"."TTZDV"
where client = '100';
insert into "SYSTEM"."TTZZ"
select * from "SAPS4D"."TTZZ"
where client = '100';

Change client to 001

update SYSTEM.TTZD set client = '001';


update SYSTEM.TTZDF set client = '001';
update SYSTEM.TTZDV set client = '001';
update SYSTEM.TTZZ set client = '001';

Check Content
select * from SYSTEM.TTZD;
select * from SYSTEM.TTZDF;
select * from SYSTEM.TTZDV;
select * from SYSTEM.TTZZ;

Reconfigure HANA database

reconfigure HANA database using the following SQL Command.


alter system reconfigure service ('indexserver','',0);

You might also like