MAXIMO中调用SQL

该博客介绍了在MAXIMO系统中如何执行SQL操作,包括利用当前日期进行数据插入和删除。首先获取当前日期,然后构建SQL语句用于在CARRFOR表中插入记录,并使用序列CARRFORIDSEQ生成唯一ID。接着执行删除操作,按年和月过滤CARRFOR表中的记录。最后通过DBManager和PreparedStatement执行SQL并提交事务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

Date currentDate = ((AppService) getMboServer()).getMXServer().getDate();

String currdate=DateUtil.SqlDateToString(currentDate);

String personid=ui.getPersonId();

String month =DateUtil.getDayOfMonth(currentDate)+"";

String year = DateUtil.getDayOfYear(currentDate)+"";

  String sql=""

  +"insert into carrfor(location,itemnum,binnum,lotnum,curbal,itemsetid,siteid,orgid,unitcost,currencycode,yinvoice,confirmcostdate,"

  +"carrforid,hasld,createby,createdate,changeby,changedate,cfdate,month,year)"

  +"select a.location,a.itemnum,a.binnum,a.lotnum,a.curbal,a.itemsetid,a.siteid,a.orgid,b.unitcost,b.currencycode,b.yoninvoice,b.confirmcostdate," 

  +"carrforidseq.nextval,1,'"+personid+"',to_date('"+currdate+"','yyyy-mm-dd hh24:mi:ss'),'"+personid+"',to_date('"+currdate+"','yyyy-mm-dd hh24:mi:ss'),to_date('"+currdate+"','yyyy-mm-dd hh24:mi:ss'),'"+month+"',

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值