oracle ebs 采购订单关闭之PL/SQL实现方法
应客户需求,需要写个脚本,批量关闭Bonus Item类型的采购订单,在metalink上搜索到一些方法,但是都测试不通。原来需要将代码生成一个并发程序。下面是测试成功的代码。
1.首先创建一个存储过程,然后在存储过程中调用PO_ACTIONS.CLOSE_PO
2.注册一个存储过程类型的并发程序
3.在application中测试结果。
CREATE OR REPLACE PROCEDURE xx_po_close
(
err_buff OUT VARCHAR2,
retcode OUT NUMBER,
p_reason_desc VARCHAR2,
p_po_from VARCHAR2,
p_po_to VARCHAR2)
AS
l_return_code VARCHAR2(2000);
l_result BOOLEAN;
CURSOR PO_CLOSE_CUR
IS
SELECT poh.segment1,
poll.po_header_id ,
poll.po_line_id ,
poll.line_location_id
from po_line_locations_all poll,
po_headers_all poh ,
po_lines_all pol
WHERE poll.po_header_id = poh.po_header_id
AND poll.po_line_id =pol.po_line_id
AND pol.po_header_id = poh.po_header_id
AND upper(poh.authorization_status)='APPROVED'
AND UPPER(poll.closed_code )='CLOSED FOR RECEIVING'
AND (pol.unit_price =0 or poh.quantity_billed - poh.quantity >=0)
AND poh.segment1 between p_po_from and p_po_to;
BEGIN
FOR PO_
相关文档:
问题一:如保加载JDBC驱动程序:
正常我们加载驱动程序有三个途径:
1.Class.forName(String)这想当于classLoader一个String指定的类,在装载时把该驱动程序的静态内容都初始化,其实这时驱动程序类调用了DriverManager.registerDriver(driver)方法。
2.使用系统属性:System.getPro ......
SQLServer和Oracle的常用函数对比
1.绝对值
S:select abs(-1) value
O:select abs(-1) value from dual
2.取整(大)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.取整(小)
S:select floor(-1.001) value
O:select floor(-1.001) valu ......
Oracle笔记
l 关于TRUNC函数
SELECT
RELATED_ID ,
DOC_ID ,
CAT_ID ,
CAT_CODE ,
RELEASE_DATE ,
&n ......
由于以前都是在sqlserver 2005处理,现在客户要求oracle数据库服务器,
最初的代码为:
allRecordSize = (Integer) rs1.getObject(1); //Integer allRecordSize=0;
当执行的时候报:BigDecimal无法转化为Integer类型
为了兼容两者修改后的代码为:
Object o = rs1.getObject(1);
&nbs ......
如果你经常遇到下面的问题,你就要考虑使用SQL Server的模板来写规范的SQL语句了:
SQL初学者。
经常忘记常用的DML或是DDL SQL 语句。
在多人开发维护的SQL中,每个人都有自己的SQL习惯,没有一套统一的规范。
在SQL Server Management Studio中,已经给大家提供了很多常用的现成SQL规范模板。
SQL Server Management ......