strsql_使用PowerRuby构建STRSQL实用程序

本教程介绍了如何使用Rails创建类似于IBMi上的STRSQL交互式会话工具,该工具完全运行在IBMi服务器上,可通过任何带浏览器的设备访问。

存档日期:2019年5月15日 | 首次发布:2014年3月20日

本教程创建了旧的绿屏Start SQL交互式会话(STRSQL)实用工具的Rails版本。 大多数IBM i专业人员在IBM i上使用STRSQL,但如果尚未使用,则只需登录到IBM i 5250,然后在命令行上输入STRSQL。 其他产品将STRSQL支持复制为客户端/服务器应用程序,但是此Rails版本完全保留在IBM i服务器上,并且可以使用任何带有浏览器的设备作为界面。

此内容不再被更新或维护。 全文以PDF格式“按原样”提供。 随着技术的飞速发展,某些内容,步骤或插图可能已更改。

翻译自: https://www.ibm.com/developerworks/ibmi/tutorials/i-power-ruby/index.html

bool CX8DbOperate::UpdateResultTime(TagExpAction & tagExpAction, CString & strRsTime) { CString strSql = _T("update %s set ResultTime = \'%s\' where id = %d"); CString strDetailSql = _T("update %s set Cycle=%d, ResultTime = \'%s\' where id = %d"); CString strTmp; if (tagExpAction.tagExpInfo.iCupType == CUPSTA_CALI) { strDetailSql = _T("update %s set Cycle=%d, ResultTime = \'%s\' where id = %d"); //定标 strTmp.Format(strDetailSql, _T("mgl_calirsdetail"), tagExpAction.tagExpInfo.iResultCycle, strRsTime, tagExpAction.tagExpInfo.iDetailRsDbid); m_pDb->Query(strTmp); strTmp.Format(strSql, _T("mgl_calirs"), strRsTime, tagExpAction.tagExpInfo.iNorRsDbid); m_pDb->Query(strTmp); } else if (tagExpAction.tagExpInfo.iCupType == CUPSTA_SMP ) { //样本 strTmp.Format(strDetailSql, _T("nor_smprsdetail"), tagExpAction.tagExpInfo.iResultCycle, strRsTime, tagExpAction.tagExpInfo.iDetailRsDbid); m_pDb->Query(strTmp); strTmp.Format(strSql, _T("nor_smprs"), strRsTime, tagExpAction.tagExpInfo.iNorRsDbid); m_pDb->Query(strTmp); } else if (tagExpAction.tagExpInfo.iCupType == CUPSTA_QC) { CString strDetailSql = _T("update %s set MglCycle=%d, ResultTime = \'%s\' where id = %d"); //质控 strTmp.Format(strDetailSql, _T("nor_qcrsdetail"), tagExpAction.tagExpInfo.iResultCycle, strRsTime, tagExpAction.tagExpInfo.iDetailRsDbid); m_pDb->Query(strTmp); strTmp.Format(strSql, _T("nor_qcrs"), strRsTime, tagExpAction.tagExpInfo.iNorRsDbid); m_pDb->Query(strTmp); } else if (tagExpAction.tagExpInfo.iCupType == CUPSTA_BGW || tagExpAction.tagExpInfo.iCupType == CUPSTA_LC_LE || tagExpAction.tagExpInfo.iCupType == CUPSTA_LC_LE2 || tagExpAction.tagExpInfo.iCupType == CUPSTA_LC_RI || tagExpAction.tagExpInfo.iCupType == CUPSTA_LC_RI2 || tagExpAction.tagExpInfo.iCupType == CUPSTA_LC_SMPARM) { //背景、左试剂针光检、右试剂针光检、样本针光检 strDetailSql = _T("update %s set Cycle=%d, ResultTime = \'%s\' where id = %d"); strTmp.Format(strDetailSql, _T("mgl_systestdetail"), tagExpAction.tagExpInfo.iResultCycle, strRsTime, tagExpAction.tagExpInfo.iDetailRsDbid); m_pDb->Query(strTmp); strTmp.Format(strSql, _T("mgl_systestinfo"), strRsTime, tagExpAction.tagExpInfo.iNorRsDbid); m_pDb->Query(strTmp); } return true; } bool CX8DbOperate::SetDetailRsStatus(set<int> setDetailRsDbid, int iStatus, int iType) { if (setDetailRsDbid.size() <= 0) return true; CString strSql; CString strDbid = CompactStr(setDetailRsDbid, _T(",")); if (iType == SMPTYPE_SMP) { strSql.Format(_T("update nor_smprsdetail set status = %d where id IN(%s)"), iStatus, strDbid); } if (iType == SMPTYPE_QC) { strSql.Format(_T("update nor_qcrsdetail set status = %d where id IN(%s)"), iStatus, strDbid); } else if (iType == SMPTYPE_CALI) { strSql.Format(_T("update mgl_calirsdetail set status = %d where id IN(%s)"), iStatus, strDbid); } else if (iType == SMPTYPE_LC) { strSql.Format(_T("update mgl_systestdetail set status = %d where id IN(%s)"), iStatus, strDbid); } return m_pDb->Query(strSql); } 这两段怎么合并成一次执行 减少花费的时间
07-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值