以上语句是同一个数据库中的判断,现在表Customer 与表BL_DWZD分别存储两个数据库中,请用怎么用事务把这个SQL改造一下
4 个解决方案
#1
同一服务器:
select cCusCode,cCusName,cCusAbbName,cDCCode,cCCCode,cCusAddress,cCusEmail,cCusPerson,cCusPhone from Customer WHERE cCCCode='"+is_currNo+"' and cCuscode IN (select DWZD_DWBH from 库名..BL_DWZD)
select cCusCode,cCusName,cCusAbbName,cDCCode,cCCCode,cCusAddress,cCusEmail,cCusPerson,cCusPhone from Customer WHERE cCCCode='"+is_currNo+"' and cCuscode IN (select DWZD_DWBH from 库名..BL_DWZD)
#2
dw_1.setsqlselect("select cCusCode,cCusName,cCusAbbName,cDCCode,cCCCode,cCusAddress,cCusEmail,cCusPerson,cCusPhone from Customer WHERE cCCCode='"+is_currNo+"' and cCuscode IN (select DWZD_DWBH from DATAMODEL..BL_DWZD)" )结果不正确
#3
dw_1.settransobject(sql_u8)
dw_1.setsqlselect("select cCusCode,cCusName,cCusAbbName,cDCCode,cCCCode,cCusAddress,cCusEmail,cCusPerson,cCusPhone from Customer WHERE cCCCode='"+is_currNo+"' and cCuscode IN (select DWZD_DWBH from DATAMODEL..BL_DWZD)" )
dw_1.retrieve( )
由于是在数据窗口中检索的,这样写不正确
dw_1.setsqlselect("select cCusCode,cCusName,cCusAbbName,cDCCode,cCCCode,cCusAddress,cCusEmail,cCusPerson,cCusPhone from Customer WHERE cCCCode='"+is_currNo+"' and cCuscode IN (select DWZD_DWBH from DATAMODEL..BL_DWZD)" )
dw_1.retrieve( )
由于是在数据窗口中检索的,这样写不正确
#4
建立个事务去连接DATAMODEL 然后 弄个数据窗口retrieve这个数据(select DWZD_DWBH from DATAMODEL..BL_DWZD) 然后取出这个窗口的数 再select cCusCode,cCusName,cCusAbbName,cDCCode,cCCCode,cCusAddress,cCusEmail,cCusPerson,cCusPhone from Customer WHERE cCCCode='"+is_currNo+"' and cCuscode IN
这样组合下吧
这样组合下吧
#1
同一服务器:
select cCusCode,cCusName,cCusAbbName,cDCCode,cCCCode,cCusAddress,cCusEmail,cCusPerson,cCusPhone from Customer WHERE cCCCode='"+is_currNo+"' and cCuscode IN (select DWZD_DWBH from 库名..BL_DWZD)
select cCusCode,cCusName,cCusAbbName,cDCCode,cCCCode,cCusAddress,cCusEmail,cCusPerson,cCusPhone from Customer WHERE cCCCode='"+is_currNo+"' and cCuscode IN (select DWZD_DWBH from 库名..BL_DWZD)
#2
dw_1.setsqlselect("select cCusCode,cCusName,cCusAbbName,cDCCode,cCCCode,cCusAddress,cCusEmail,cCusPerson,cCusPhone from Customer WHERE cCCCode='"+is_currNo+"' and cCuscode IN (select DWZD_DWBH from DATAMODEL..BL_DWZD)" )结果不正确
#3
dw_1.settransobject(sql_u8)
dw_1.setsqlselect("select cCusCode,cCusName,cCusAbbName,cDCCode,cCCCode,cCusAddress,cCusEmail,cCusPerson,cCusPhone from Customer WHERE cCCCode='"+is_currNo+"' and cCuscode IN (select DWZD_DWBH from DATAMODEL..BL_DWZD)" )
dw_1.retrieve( )
由于是在数据窗口中检索的,这样写不正确
dw_1.setsqlselect("select cCusCode,cCusName,cCusAbbName,cDCCode,cCCCode,cCusAddress,cCusEmail,cCusPerson,cCusPhone from Customer WHERE cCCCode='"+is_currNo+"' and cCuscode IN (select DWZD_DWBH from DATAMODEL..BL_DWZD)" )
dw_1.retrieve( )
由于是在数据窗口中检索的,这样写不正确
#4
建立个事务去连接DATAMODEL 然后 弄个数据窗口retrieve这个数据(select DWZD_DWBH from DATAMODEL..BL_DWZD) 然后取出这个窗口的数 再select cCusCode,cCusName,cCusAbbName,cDCCode,cCCCode,cCusAddress,cCusEmail,cCusPerson,cCusPhone from Customer WHERE cCCCode='"+is_currNo+"' and cCuscode IN
这样组合下吧
这样组合下吧