首页 > 解决方案 > 运行通过 SQL Developer 将 xml 作为输入的过程时出现“必须声明过程”错误

问题描述

我有一个以 XML(数据类型 CLOB)作为输入的存储过程。当我通过 Mule 应用程序执行 SP 时,它运行良好。但是,我想通过将 XML 文件作为输入直接通过 SQL Developer 测试 SP。当我运行 SP 时,它显示“ORA-06550:和 PLS-00201:必须声明 SP”。我正在寻找有关如何通过 SQL 开发人员直接测试 SP 而不会出现此错误的建议和建议。

我尝试通过 CTRL+F10 窗口和 Execute 命令执行 SP。我也尝试在单行和多行中提供 XML 输入。

当我通过 SQL Developer 运行时,它会在发生错误时尝试执行以下语句(下面的错误截图)

DECLARE
  VOUCHERXML CLOB;
BEGIN
  VOUCHERXML := '<?xml version="1.0" encoding="UTF-8"?> <Voucher type="SGLP" sourceSystem="WRS" origin="WRS|CAN" refID="" paymentID="wmict:31228"> <TransferredFrom/> <TransferredTo/> <PolicyLOBSource/> <InvoiceNumber/> <InvoiceDate>2013-10-14</InvoiceDate> <AccountingDate>2013-10-14</AccountingDate> <PayDate>2013-10-14</PayDate> <Currency>CAD</Currency> <InvoiceAmount>50.00</InvoiceAmount> <Vendor sourceSystemID="" targetSystemID="CLAIMS||CAN|CAD|English"/> <Payment> <PayTo sourceSystemID=""> <Payees> <Payee>QAG - PMS Ontario Broker 4</Payee> <Payee/> <Payee/> <Payee/> <Payee/> </Payees> <AddressLine1 print="false">Unit 333 ABC steet</AddressLine1> <AddressLine2 print="false">Toronto, ON</AddressLine2> <City print="false">Toronto</City> <State print="false">On</State> <ZipCode print="false">M4C 1P5</ZipCode> <Country print="false">CAN</Country> </PayTo> <MailTo> <AddressLine1>QAG - PMS Ontario Broker 4</AddressLine1> <AddressLine2>Unit 333 ABC steet</AddressLine2> <AddressLine3>Toronto, ON</AddressLine3> <AddressLine4/> <AddressLine5/> <City>Toronto</City> <State>ON</State> <ZipCode>M4C 1P5</ZipCode> <Country>CA</Country> </MailTo> </Payment> <PaymentDetails> <BankName>CLAIMS|VENDOR|CAN|CAD|English</BankName> <AccountNumber>CLAIMS|VENDOR|REGULAR|CAN|CAD|English</AccountNumber> </PaymentDetails> <Memo1/> <Memo2/> <Memo3/> <Memo4>PAIEMENT PLANIFIǯSCHEDULED PAYMENT: FROM OCT 14 2013 TO OCT 27 2013</Memo4> <InsuredName>DANIELLE CLAIMS</InsuredName> <PolicyNumber>7025925</PolicyNumber> <ClaimNumber>007110000001300</ClaimNumber> <VoucherLines> <VoucherLine> <Description/> <Amount>50.00</Amount> <Instructions>Claim 007110000001300</Instructions> <CheckNumber/> <Distributions> <Distribution> <DistributionPolicyLOBCode/> <ProductLookupKey/> <DepartmentLookupKey>07|67|||1</DepartmentLookupKey> <Amount statistical="false">50.00</Amount> <AccountNumber>loss|unspecified</AccountNumber> <BusinessUnit>100</BusinessUnit> <BusinessSegment/> <Description/> <DepartmentCode>07|67|||1</DepartmentCode> <ProductCode/> <RiskLocation>67</RiskLocation> <AccidentYear>2013</AccidentYear> <Reinsurance/> <BusinessSegmentAffiliate/> <TransactionType/> <TypeBureau/> <CoverageGroup>ANC_614</CoverageGroup> <PolicySearchResult> <AltaGridInd/> <TypeOfBusiness/> <VehicleType/> <TypeOfUse/> <TypeBureau/> <Form/> <FacilityIndicator/> <PolicyType/> <ExpansionCd/> <SubClass/> </PolicySearchResult> <PolicySearchInput> <LOB>ANC</LOB> <LossDate>2013-08-21</LossDate> <BranchNumber>07</BranchNumber> <PolicyNumber>7025925</PolicyNumber> <PolicyModule/> <MajorPerilSequence/> <MajorPeril>614</MajorPeril> <UnitNumber>1</UnitNumber> </PolicySearchInput> </Distribution> </Distributions> </VoucherLine> </VoucherLines> </Voucher>';

  IMPORT_VOUCHER_TO_PEOPLESOFT_TEST(
    VOUCHERXML => VOUCHERXML
  );
--rollback; 
END;

我希望在执行 SP 时加载一些表。

下面是错误截图:

错误信息

标签: oraclestored-proceduresplsqloracle-sqldeveloper

解决方案


推荐阅读