自行百度视图的用法就好了,就是一张不能直接编辑的虚拟表,对labview来说,和直接查询一张表是一样的,程序无需做任何改动。
IF OBJECT_ID ('dbo.m_ViewBag_v') IS NOT NULL
DROP VIEW dbo.m_ViewBag_v
GO
CREATE VIEW [dbo].[m_ViewBag_v]
AS
替换成你自己的SELECT语句
--SELECT dbo.m_ViewCartonSn_v.ppid, dbo.m_ViewCartonSn_v.Cartonid, dbo.m_ViewCartonSn_v.ppidQty,
-- dbo.m_ViewCartonSn_v.Userid, dbo.m_ViewCartonSn_v.Status, dbo.m_ViewCartonSn_v.Intime,
-- dbo.m_ViewCartonSn_v.Mark1, View_carton.Cartonid AS Expr1, View_carton.Moid, View_carton.PartID,
-- View_carton.PackId, View_carton.PackItem, View_carton.StationId, View_carton.StationName, View_carton.Cartonqty,
-- View_carton.PackingQuantity, View_carton.CartonStatus, View_carton.Teamid, View_carton.Userid AS Expr2,
-- View_carton.Intime AS Expr3, View_carton.Whid, View_carton.Areaid, View_carton.Floorid, View_carton.Packlink,
-- View_carton.Updateuser, View_carton.Updatetime, View_carton.Status AS Expr4, View_carton.Mark1 AS Expr5,
-- View_carton.Mark2
--FROM dbo.m_ViewCartonSn_v LEFT OUTER JOIN
-- (SELECT ct.Cartonid, ct.Moid, mm.PartID, ct.PackId, ct.PackItem, ct.StationId, ct.StationName, ct.Cartonqty,
-- ct.PackingQuantity, ct.CartonStatus, ct.Teamid, ct.Userid, ct.Intime, ct.Whid, ct.Areaid, ct.Floorid, ct.Packlink,
-- ct.Updateuser, ct.Updatetime, ct.Status, ct.Mark1, ct.Mark2
-- FROM mes_prd.MESDB.dbo.m_Carton_t AS ct INNER JOIN
-- mes_prd.MESDB.dbo.m_Mainmo_t AS mm ON ct.Moid = mm.Moid
-- WHERE (ct.Teamid IN ('XT026', 'XT027'))) AS View_carton ON
-- dbo.m_ViewCartonSn_v.Cartonid = View_carton.Cartonid
--WHERE (dbo.m_ViewCartonSn_v.Userid IN ('L000006', 'C052119'))
GO