SQL Used TO Retrieve country region from hybris

创建国家表

CREATE TABLE `country` (
  `PK` bigint(20) NOT NULL DEFAULT '0',
  `activeflag` tinyint(1) DEFAULT NULL,
  `isocode` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`PK`),
  KEY `ISOCode_34` (`isocode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

导入数据到新表

INSERT INTO country (PK,activeflag,ISOCODE) SELECT PK,activeflag,ISOCODE FROM COUNTRIES;

创建多语言表

CREATE TABLE `countrylp` (
  `ITEMPK` bigint(20) NOT NULL DEFAULT '0',
  `locale` varchar(20) NOT NULL ,
  `name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`ITEMPK`,`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

导入数据

INSERT INTO countrylp (`ITEMPK`,`locale`,`name`)
select lp.ITEMPK as ITEMPK,la.isocode as locale,p_name as name from gucci.countrieslp lp, gucci.languages la 
where la.pk=lp.langpk;

创建 导入 regions

CREATE TABLE `region` (
  `PK` bigint(20) NOT NULL DEFAULT '0',
  `activeflag` tinyint(1) DEFAULT NULL,
  `isocode` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `countrypk` bigint(20) DEFAULT NULL,
  `isocodeshort` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`PK`),
  KEY `ISOCode_35` (`isocode`),
  KEY `Region_Country_35` (`countrypk`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


INSERT INTO region (PK,activeflag,isocode,countrypk,isocodeshort) SELECT PK,activeflag,isocode,countrypk,p_isocodeshort FROM regions;

导入多语言

CREATE TABLE `regionlp` (
  `ITEMPK` bigint(20) NOT NULL DEFAULT '0',
  `locale` varchar(20) NOT NULL DEFAULT '0',
  `name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`ITEMPK`,`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

INSERT INTO regionlp (`ITEMPK`,`locale`,`name`)
select lp.ITEMPK as ITEMPK,la.isocode as locale,p_name as name from gucci.regionslp lp, gucci.languages la 
where la.pk=lp.langpk;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值