oracle数据库 dblink 连接 sqlserver数据库,跨库创建视图使用union all时报:字符集不匹配

create or replace view SCADA_NET_HISTORY_V as
select
a1."DeviceName",
a1."DeviceNo",
m1."SeckId",
m1."MeterName",
t1."TypeName",
c1."ChannelNo",
d1."DataTime",
d1."Data"
from Channel@msql c1,
Device@msql a1,
DataType@msql t1,
Data_21@msql d1,
Meter@msql m1
where c1."DeviceId"=a1."DeviceId"
and c1."DataTypeId"=t1."DataTypeId"
and d1."ChannelId"=c1."ChannelId"
and m1."MeterId"=c1."MeterId"
union all
select
a2."DeviceName",
a2."DeviceNo" ,
m2."SeckId",
m2."MeterName",
t2."TypeName",
c2."ChannelNo",
d2."DataTime",
d2."Data"
from Channel@msql c2,
Device@msql a2,
DataType@msql t2,
Data_23@msql d2,
Meter@msql m2
where c2."DeviceId"=a2."DeviceId"
and c2."DataTypeId"=t2."DataTypeId"
and d2."ChannelId"=c2."ChannelId"
and m2."MeterId"=c2."MeterId"

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问