SAP HANA Studio 建模初体验

SAP HANA Studio 建模:

创建表:

Person表:

ID                        VARCHAR    3
NAME                 VARCHAR    20
LAST_NAME     VARCHAR    30
DOB                    VARCHAR   8


Create ROW  Table Person(

   ID VARCHAR(3) PRIMARY KEY,

   NAME VARCHAR(20),

   LAST_NAME  VARCHAR(30),

  DOB  VARCHAR(8)
)

PROJECT表:

ID                          VARCHAR     3    Key Field
NAME                   VARCHAR     20  Key Field
RESOURCES    INTEGER
BUDGET             DECIMAL       8,2

Create Column  Table  PROJECT(

   ID VARCHAR(3) NOT NULL,

   NAME VARCHAR(20) NOT NULL,

   RESOURCES  integer,

  BUDGET   decimal(8,2),
  PRIMARY KEY(ID,NAME)
)

 

 

插入数数据:

insert into "P1526659201"."PERSON" values('001','John','Smith','19750112');
insert into "P1526659201"."PERSON" values('002','John','Doe','19800101');
insert into "P1526659201"."PERSON" values('003','Joe','Page','19760228');
insert into "P1526659201"."PERSON" values('004','Sally','Ryan','19771230');
insert into "P1526659201"."PERSON" values('005','John','Sanders','19451122');
insert into "P1526659201"."PERSON" values('006','Peter','McDonald','19670818');
insert into "P1526659201"."PERSON" values('007','Mike','Melvin','19750812');
insert into "P1526659201"."PERSON" values('008','Chris','Jones','19750813');
insert into "P1526659201"."PERSON" values('009','Daniel','Stone','19720726');
insert into "P1526659201"."PERSON" values('010','Judy','Jones','19701210');
insert into "P1526659201"."PERSON" values('011','Mike','Peters','19810404');
insert into "P1526659201"."PERSON" values('012','Joshua','Reynolds','19750217');
insert into "P1526659201"."PERSON" values('013','Anne','Word','19710310');
insert into "P1526659201"."PERSON" values('014','Jeff','Field','19681215');
insert into "P1526659201"."PERSON" values('015','Megan','Ford','19700909');

 

insert into "P1526659201"."PROJECT" values('001','ABAP Models',2,10456.34);
insert into "P1526659201"."PROJECT" values('001','ABAP on Eclipse',5,20000.00);
insert into "P1526659201"."PROJECT" values('001','ABAP on HANA',2,45500.00);
insert into "P1526659201"."PROJECT" values('002','SUP Apps',3,3567.12);
insert into "P1526659201"."PROJECT" values('003','Code Refactoring',1,5120.50);
insert into "P1526659201"."PROJECT" values('004','SAPScript convertion',5,567.90);
insert into "P1526659201"."PROJECT" values('004','Adobe Forms Docs',2,345.19);
insert into "P1526659201"."PROJECT" values('004','Smart Forms Docs',6,462.10);
insert into "P1526659201"."PROJECT" values('004','Smart/Adobe Forms',2,234.90);
insert into "P1526659201"."PROJECT" values('005','HANA Apps',2,50000.00);   
insert into "P1526659201"."PROJECT" values('005','BW on HANA',4,50000.00);
insert into "P1526659201"."PROJECT" values('006','Flex Apps',7,3500.50);
insert into "P1526659201"."PROJECT" values('006','Dashboards',3,2345.29);
insert into "P1526659201"."PROJECT" values('006','XCelsius',4,5678.10);
insert into "P1526659201"."PROJECT" values('007','ABAP Classes',2,1250.10);
insert into "P1526659201"."PROJECT" values('008','OSS Notes',2,2500.00);
insert into "P1526659201"."PROJECT" values('009','SUP Killer Apps',2,5600.50);
insert into "P1526659201"."PROJECT" values('009','SAP Gateway',7,5800.00);
insert into "P1526659201"."PROJECT" values('009','SUP and Gateway',5,5678.00);
insert into "P1526659201"."PROJECT" values('010','Blue Ruby',6,3500.00);
insert into "P1526659201"."PROJECT" values('010','Blue Python',4,3500.00);
insert into "P1526659201"."PROJECT" values('011','ABAP Editor',5,4000.00);
insert into "P1526659201"."PROJECT" values('011','ABAP Debugger',5,2000.00);
insert into "P1526659201"."PROJECT" values('012','EP',5,8500.50);
insert into "P1526659201"."PROJECT" values('012','KM',5,6500.50);
insert into "P1526659201"."PROJECT" values('012','MI',3,4500.50);
insert into "P1526659201"."PROJECT" values('013','SAP Education',6,5000.00);
insert into "P1526659201"."PROJECT" values('013','Certifications',3,3000.00);
insert into "P1526659201"."PROJECT" values('014','SAP FI',4,500.50);
insert into "P1526659201"."PROJECT" values('014','SAP SD',6,400.50);
insert into "P1526659201"."PROJECT" values('014','SAP CO',3,500.40);
insert into "P1526659201"."PROJECT" values('014','SAP MM',7,400.50);
insert into "P1526659201"."PROJECT" values('014','SAP WM',2,300.99);
insert into "P1526659201"."PROJECT" values('015','Research',1,5000.00);
insert into "P1526659201"."PROJECT" values('015','Development',4,8000.00);

 

创建Area表:

ID           VARCHAR     3    Key field
AREA     VARCHAR    20

 create column table area (
id varchar(3) primary key,
area varchar(20)
);

获取连接SAP HANA服务器的FTP账号的相关信息:

SELECT * FROM SYSTEM.FTP_SERVER

SAP HANA Studio 建模初体验_第1张图片

 

创建文件Area.ctl,并把Area.ctl上传到 /BLOG,Area.ctl文件内容为

import data into table P1526659201."AREA" 
 from 'Area.csv'
 record delimited by '\n' 
 fields delimited by ','
 optionally enclosed by '"'
 error log 'Area.err'

打开SQL Edit执行导入数据语句:

IMPORT FROM '/dropbox/Blag/Area.ctl';

 

你可能感兴趣的:(SAP)