我是这样写的..前台:<br>ADODataSet1.Close ;<br> ADODataSet1.CommandType :=cmdUnknown ;<br> ADODataSet1.Parameters.Clear;<br> ADODataSet1.CommandText := '{call VCWIP_JOB_FND50ITEM_PKG.job_fnd50item(?,?)}' ;<br> ADODataSet1.Parameters.CreateParameter('p1',ftString,pdInput ,10,JobNo);<br> ADODataSet1.Parameters.CreateParameter('p2',ftFloat,pdinput,4,OptSeq);<br> ADODataSet1.Open;<br>[red]-------------------------oracle pak:[/red]<br>CREATE OR REPLACE PACKAGE VCWIP_JOB_FND50ITEM_PKG AS<br>/*<br> REM ===============================================================<br> REM = Copyright (C) 2004 <VTECH><br> REM = <LIAOBU,CHINA><br> REM = All rights reserved<br> REM ===============================================================<br> REM<br> REM $Header : VCWIP_JOB_FND50ITEM_PKG.pls V 2.4 02-Jan-2007 $<br> REM PROGRAM NAME: VCWIP_JOB_FND50ITEM_PKG<br> REM PROGRAMMER : SZ_CEN<br> REM DATE : 2009-09-17<br> REM PURPOSE : for SMD outstanding Jobs <br> REM PARAMETERS :<br> REM CALLED :<br> REM CALLED BY : <br> REM DESCRIPTION :<br> REM<br> REM UPDATE HISTORY<br> REM<br> REM DATE NAME DESCRIPTION<br> REM ---------- --------------- ---------------------------<br> REM 2007-09-17 SZ_CEN Initialize!<br> ===============================================================================*/<br> type mytype is ref cursor; --return VCBOM_EXPLODER_DATA%rowtype;<br><br><br> PROCEDURE JOB_FND50ITEM(--ERRBUF OUT VARCHAR2,<br> --RETCODE OUT NUMBER,<br> P_JOB_NUMBER IN varchar2,<br> p_opseq in number,<br> mycurs out mytype);<br> <br><br>END VCWIP_JOB_FND50ITEM_PKG;<br>/<br>[red]-----------------pak body-----[/red]<br>CREATE OR REPLACE PACKAGE BODY vcwip_job_fnd50item_pkg<br>AS<br> PROCEDURE job_fnd50item (--ERRBUF OUT VARCHAR2,<br> --RETCODE OUT NUMBER,<br> p_job_number IN varchar2,<br> p_opseq in number,<br> mycurs out mytype)<br> IS<br> v_org_id number;<br> v_job_no wip_entities.wip_entity_name%TYPE;<br> v_effective_date DATE;<br> v_80item VARCHAR2 (40);<br> ln_conc_request_id number := NVL( fnd_global.conc_request_id, -1 
;<br> lv_error varchar2(100);<br> lv_message VARCHAR2(100);<br> -- c_item mytype%rowtype;<br> BEGIN<br> SELECT wip.ORGANIZATION_ID,<br> --wip.wip_entity_name, <br> wdj.scheduled_start_date, <br> msi.segment1<br> INTO v_org_id,<br> --v_job_no, <br> v_effective_date, <br> v_80item<br> FROM wip_entities wip, <br> wip_discrete_jobs wdj,<br> mtl_system_items msi<br> WHERE 1 = 1<br> AND wip.wip_entity_id = wdj.wip_entity_id<br> AND wip.organization_id = wdj.organization_id<br> --AND wip.wip_entity_id = wro.wip_entity_id<br> --and wro.wip_entity_id = 121238<br> AND wip.wip_entity_name =p_job_number --'1125770'<br> --and wro.operation_seq_num = 136<br> AND wip.primary_item_id = msi.inventory_item_id<br> AND wip.organization_id = msi.organization_id;<br> <br> BEGIN <br> lv_message := VCBOM_EXPLODER_UTIL_PKG.VCBOM_EXPLODER_LOW_FUNC<br> ( P_ORGANIZATION_ID => v_org_id,<br> P_ASSEMBLY_ITEM_FROM => v_80item,<br> P_ASSEMBLY_ITEM_TO => v_80item,<br> P_IMPL_FLAG => 2, --1(Yes) means Un-Implementation Item Only, 2(No) means Nothing!<br> P_ALTERNATE_BILL => NULL,<br> P_REQUEST_ID => ln_conc_request_id, <br> P_ERROR_MESSAGE => lv_error,<br> P_SORT_BY => NULL,<br> P_DISPLAY_TYPE =>'2', --Value-Set:[BOM_SRS_INDENTED_BILL_DISPLAY_TYPE]<br> --[1]=All, [2]=Current, [3]=Future an current<br> P_EFFECTIVE_DATE => v_effective_date<br>  
;<br> EXCEPTION<br> WHEN OTHERS THEN<br> fnd_file.put_line( fnd_file.LOG, '*Error when call VCBOM_EXPLODER_UTIL_PKG.VCBOM_EXPLODER_LOW_FUNC, sqlerrm = '<br> || SQLERRM);<br> END; <br> <br> open mycurs for <br> select distinct--msi_80.segment1 80_item, msi_80.description 80_desc, ved.LEVEL_ID,<br> msi_50.segment1 --, msi_50.description <br> from VCBOM_EXPLODER_DATA ved, <br> mtl_system_items msi_80,<br> mtl_system_items msi_50<br> -- BOM_DEPARTMENTS BD,<br> -- MFG_LOOKUPS ML1,<br> -- WIP_REQUIREMENT_OPERATIONS WRO<br> where 1=1 <br> and ved.REQUEST_ID = ln_conc_request_id<br> and msi_80.inventory_item_id = ved.ASSEMBLY_ITEM_ID<br> and msi_80.organization_id = ved.ORGANIZATION_ID <br> and upper(msi_50.description) like upper('SMD%')<br> and ved.OPERATION_SEQ_NUM = p_opseq<br> and msi_50.inventory_item_id = ved.COMPONENT_ITEM_ID<br> and msi_50.organization_id = ved.ORGANIZATION_ID <br> --and msi_50.inventory_item_id = wro.INVENTORY_ITEM_ID<br> --and msi_50.organization_id = wr
RGANIZATION_ID<br> --and wr
PERATION_SEQ_NUM = 136--p_opseq<br> --and wro.DEPARTMENT_ID = bd.DEPARTMENT_ID<br> --and upper(bd.DEPARTMENT_CODE) like upper('SMD%')<br> /*select msi_50.segment1, msi_50.description<br> from VCBOM_EXPLODER_DATA ved, <br> mtl_system_items msi_80,<br> mtl_system_items msi_50<br> -- BOM_DEPARTMENTS BD,<br> -- MFG_LOOKUPS ML1,<br> -- WIP_REQUIREMENT_OPERATIONS WRO<br> where 1=1 <br> and ved.REQUEST_ID = ln_conc_request_id<br> and msi_80.inventory_item_id = ved.ASSEMBLY_ITEM_ID<br> and msi_80.organization_id = ved.ORGANIZATION_ID <br> and upper(msi_50.description) like upper('SMD%')<br> and ved.OPERATION_SEQ_NUM = p_opseq<br> and msi_50.inventory_item_id = ved.COMPONENT_ITEM_ID<br> and msi_50.organization_id = ved.ORGANIZATION_ID <br> */<br> ; <br> <br> /* for r_item in c_item<br> loop<br> fnd_file.put_line(fnd_file.LOG,r_item.segment1 ||' '||r_item.description);<br> end loop; <br> */ <br> END;<br>END vcwip_job_fnd50item_pkg;<br>/