以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]将一个二层结构的管理系统转换为三层结构时,部分表无法加载,报错 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=123623) |
|
-- 作者:sjx71 -- 发布时间:2018/8/19 17:36:00 -- [求助]将一个二层结构的管理系统转换为三层结构时,部分表无法加载,报错 将一个二层结构的管理系统转换为三层结构时,只有部分表无法加载,报错 可能是什么问题,请老师指导
|
|
-- 作者:有点蓝 -- 发布时间:2018/8/19 17:59:00 -- 什么数据库?新建一个项目,单独加载上面出错的表有没有问题? |
|
-- 作者:sjx71 -- 发布时间:2018/8/19 18:02:00 -- SQL Server数据库,加载的是一个视图,二层结构时没有问题 |
|
-- 作者:有点蓝 -- 发布时间:2018/8/19 20:18:00 -- 我测试web数据源加载视图没有问题,你的视图怎么加载的? |
|
-- 作者:sjx71 -- 发布时间:2018/8/19 21:03:00 -- SEL ECT dbo.p_public_watch.public_u_unit AS 单位名称, dbo.p_public_watch.meter_name AS 表名称, dbo.p_public_watch.meter_state AS 表状态, dbo.p_public_watch.card_number AS 卡号, dbo.p_public_watch.puse AS 用途, dbo.p_public_watch.meter_address AS 表位置, dbo.p_public_watch.meter_type AS 表类型, dbo.p_public_watch.installation_date AS 安装日期, CONVERT(datetime, dbo.p_public_watch.ventilate_date) AS 通气日期, CONVERT(datetime, dbo.p_public_watch.start_date) AS 启用日期, CONVERT(datetime, dbo.p_public_watch.operat_time) AS 操作日期, dbo.p_public_watch.operater_name AS 操作人员, dbo.p_public_watch.remarks AS 备注, dbo.p_public_watch.Equipment_Situation AS 设备信息, dbo.p_public_watch.ventilation_people AS 通气人, dbo.p_public_watch.m_t_manufacturers AS 机表厂家, dbo.p_public_watch.machine_t_type AS 机表型号, dbo.p_public_watch.m_t_sequence AS 机表序列号, CONVERT(datetime, dbo.p_public_watch.m_t_productiondate) AS 机表出厂日期, dbo.p_public_watch.m_t_stress AS 机表工作压力, dbo.p_public_watch.m_t_temperature AS 机表工作温度, dbo.p_public_watch.m_t_flow AS 机表工作流量, CONVERT(datetime, dbo.p_public_watch.c_production_date) AS 卡控出厂日期, dbo.p_public_watch.card_c_factory AS 卡控厂家, dbo.p_public_watch.card_type AS 卡控型号, dbo.p_public_watch.card_sequence AS 卡控序列号, dbo.p_public_watch.card_stress AS 卡控工作压力, dbo.p_public_watch.exchange_meter AS 换表, CONVERT(bit, dbo.p_public_watch.is_mixin) AS 是否混用, dbo.p_public_watch.is_sale AS 是否停售, CONVERT(bit, dbo.p_public_watch.w_equipment_m) AS 设备信息与选型是否一致, CONVERT(bit, dbo.p_public_watch.walertor_quality) AS 报警器资质是否已收, CONVERT(bit, dbo.p_public_watch.walertor_valve) AS 报警器与切断阀是否联动, CONVERT(bit, dbo.p_public_watch.with_valve_gas) AS 检测阀关是否不过气, dbo.p_public_watch.id AS 表ID, dbo.p_public_watch.p_user_id AS 单位ID, dbo.p_public_muser.area AS 区域, dbo.p_public_muser.two_area AS 二级区域, dbo.p_public_muser.orientation AS 片区, dbo.p_public_muser.gas_state AS 用气状态, CONVERT(bit, CASE p_public_muser.is_cng WHEN \'是\' THEN 1 ELSE \'0\' END) AS 是否为煤改气, CONVERT(bit, CASE p_public_muser.is_regulator WHEN \'是\' THEN 1 ELSE \'0\' END) AS 是否为调压站箱, dbo.p_public_muser.address AS 地址, dbo.p_public_muser.Contacts_Phone AS 联系方式, dbo.p_public_machine_type.pass_meter_count AS 过表值, dbo.p_public_watch.pin_date AS 表销户日期 FROM dbo.p_public_watch LEFT OUTER JOIN dbo.p_public_machine_type ON dbo.p_public_watch.machine_t_type = dbo.p_public_machine_type.machine_type LEFT OUTER JOIN dbo.p_public_muser ON dbo.p_public_watch.p_user_id = dbo.p_public_muser.id sel ect * from {V_P_Public_Watch} where 表状态 = \'正常\'
|
|
-- 作者:有点蓝 -- 发布时间:2018/8/19 21:30:00 -- sel ect * from {V_P_Public_Watch}在什么地方用?直接在数据库执行有没有问题? [此贴子已经被作者于2018/8/19 21:30:32编辑过]
|
|
-- 作者:sjx71 -- 发布时间:2018/8/19 22:13:00 -- 直接在数据库中运行 sel ect * from [SYRQ_GJYY].[dbo].[V_P_Public_watch] 正常
|
|
-- 作者:有点蓝 -- 发布时间:2018/8/19 22:18:00 -- 做个测试数据库和例子过来看看。我测试是可以使用的 |
|
-- 作者:sjx71 -- 发布时间:2018/8/19 23:44:00 -- FROM dbo.p_public_watch LEFT OUTER JOIN dbo.p_public_machine_type ON dbo.p_public_watch.machine_t_type = dbo.p_public_machine_type.machine_type LEFT OUTER JOIN dbo.p_public_muser ON dbo.p_public_watch.p_user_id = dbo.p_public_muser.id 但为什么在二层结构中能够显示出视图的内容?
|
|
-- 作者:有点蓝 -- 发布时间:2018/8/20 8:48:00 -- 最好有个例子测试,我们才能找到原因 |