GGSCI (chenyj-WorkPC) 37> view param msrep1
REPLICAT MSREP1
setenv(NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
targetdb ggs_nc
GETTRUNCATES
APPLYNOOPUPDATES
SOURCEDEFS dirdef/source.def
--MAP scott.customer, TARGET dbo.customer;
map scott.myemps, target dbo.myemps,
COLMAP (USEDEFAULTS,
WAGES = @COMPUTE(SALARY * 12)
FULL_NAME = @STRCAT(LAST_NAME,",",FIRST_NAME));
first_name与last_name都可以正确的从oracle复制到MSSQL,但是当涉及到字符串的拼接时,结果就出现了问题。可以查看图片
可以采用触发器的方式解决问题
附MSSQL触发器:
-- ================================================
-- Template generated from Template Explorer using:
-- Create Trigger (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- See additional Create Trigger templates for more
-- examples of different Trigger statements.
--
-- This block of comments will not be included in
-- the definition of the function.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Create date:
-- Description:
-- =============================================
alter TRIGGER my_trig
ON dbo.myemps
after INSERT
AS
declare @first_name varchar(200), @last_name varchar(200), @id numeric;
BEGIN
update myemps set full_name = inserted.first_name + inserted.last_name from inserted where inserted.id = myemps.id
-- Insert statements for trigger here
END
GO