DELETE FROM DC2.OR_100 WHERE PV_USER = '377';
commit;
INSERT INTO DC2.OR_100 (PV_KEY,PV_USER,PV1,PV2,PV3,PV4,PV5,PV6,PV7)
SELECT LPAD(TO_CHAR(ROWNUM),20,0),TABLE_SELECT.* FROM (
SELECT '377'
 ,SUBSTRB(RTRIM(TO_CHAR(T001.TOR_CD)),1,100) AS A001
 ,SUBSTRB(TO_CHAR(T001.TOR_KB,'FM999999999999990'),1,100) AS A002
 ,SUBSTRB(RTRIM(TO_CHAR(T001.TOR_MEI)),1,100) AS A003
 ,SUBSTRB(RTRIM(TO_CHAR(T001.KUNI_CD2)),1,100) AS A004
 ,SUBSTRB(RTRIM(TO_CHAR(T001.TUKA_CD)),1,100) AS A005
 ,SUBSTRB(RTRIM(TO_CHAR(T001.TANTO_MEI)),1,100) AS A006
 ,SUBSTRB(RTRIM(TO_CHAR(T001.YUBIN)),1,100) AS A007
FROM
DC2_DEMO.SAM_TORIHIKI T001
ORDER BY
  T001.TOR_CD
) TABLE_SELECT
;
commit;
EXIT;


