Call Function from PLSQL--ORA-31013 : Invalid XPATH expressioon

I tried the following SQL statement. when I called function,it giving error.
select *
from v$version;
1
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
2
PL/SQL Release 10.2.0.3.0 - Production
3
CORE              10.2.0.3.0
Production
4
TNS for Linux: Version 10.2.0.3.0 - Production
5
NLSRTL Version 10.2.0.3.0 - Production
function READ_SYSTEM_RESPONSE(PARAM IN CLOB)
  RETURN NUMBER
  AS
    l_namespace varchar2(1000):='xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader PackageProxy.xsd"
                                xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader"
                                xmlns:ef="http://www.efatura.gov.tr/package-namespace"
                                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"';
    x  XMLTYPE
      := XMLTYPE('<?xml version="1.0" encoding="UTF-8"?>
                    <sh:StandardBusinessDocument xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader PackageProxy.xsd"
                      xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader"
                      xmlns:ef="http://www.efatura.gov.tr/package-namespace"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <sh:StandardBusinessDocumentHeader>
                <sh:HeaderVersion>1.0</sh:HeaderVersion>
                </sh:StandardBusinessDocumentHeader>
                </sh:StandardBusinessDocument>');
    CURSOR ana IS
          SELECT 1--EXTRACTVALUE(VALUE (p),'/sh:StandardBusinessDocumentHeader/sh:HeaderVersion',l_namespace) AS IMZA
          FROM TABLE(XMLSEQUENCE (EXTRACT (x,'/sh:StandardBusinessDocument',l_namespace))) p;
    BEGIN
    FOR r IN ana
    loop
    dbms_output.put_line('- - - - - - -');
    end loop;
    RETURN 1;
    EXCEPTION WHEN OTHERS THEN
    dbms_output.put_line(sqlerrm);
      RETURN 0;
    END;

odie_63 wrote:
Remove this from the l_namespace string, it has nothing to do in there, it's not a namespace declaration :
xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader PackageProxy.xsd
As a general rule, just declare the namespace(s) - default or prefixes - you need to resolve the XPath expression.
Once you correct that part, you'll discover that your query returns NULL.
That's because the XPath doesn't point to any node.
Try this instead :
SELECT EXTRACTVALUE(
        VALUE (p)
      , '/sh:StandardBusinessDocument/sh:StandardBusinessDocumentHeader/sh:HeaderVersion'
      , l_namespace
      ) AS IMZA
FROM TABLE(
      XMLSEQUENCE(
        EXTRACT (x, '/sh:StandardBusinessDocument', l_namespace)
    ) p
Thanks odie_63,You're right. I removed " xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader PackageProxy.xsd" and It is working!

Similar Messages

  • ORA-31013: Invalid XPATH expression -  Oracle9i

    Hello, I have to write a secure website call and below is the code snippet. I am getting following error
    ORA-31013: Invalid XPATH expression
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 104
    This is on Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    Code snippet
    soap_request :=
    '<?xml version="1.0" encoding="utf-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <NewOrder xmlns="urn:ws.xtech.net/xtechGateway">
    <newOrderRequest xsi:type="ns1:NewOrderRequestElement" xmlns:ns1="urn:ws.xtech.net/xtechGateway" xmlns="">
    <ns1:xConnectionUsername>'
    || 'XXXXXXXX'
    || '</ns1:xConnectionUsername>';
    UTL_HTTP.SET_WALLET ( 'file:/devdb/9.2.0/appsutil/wallet', 'password' );
    http_req :=
    UTL_HTTP.begin_request
    ('https://wsvar.xtech.net/xtechGateway',
    'POST',
    'HTTP/1.1'
    UTL_HTTP.set_header (http_req, 'Content-Type', 'text/xml');
    UTL_HTTP.set_header (http_req, 'Content-Length', LENGTH (soap_request));
    utl_http.set_header(http_req, 'SOAPAction', '');
    UTL_HTTP.write_text (http_req, soap_request);
    http_resp := UTL_HTTP.get_response (http_req);
    UTL_HTTP.read_text (http_resp, soap_respond);
    UTL_HTTP.end_response (http_resp);
    *resp := XMLTYPE.createxml (soap_respond);
    resp :=
    resp.EXTRACT
    ('/soap:Envelope/soap:Body/child::node()',
    'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
    v_resp :=
    resp.EXTRACT ('NewOrderResponse/return/text ()', '"approvalStatus"').getstringval
    Not sure where Am I doing wrong. Please help
    Thanks,
    R

    Okay, I have removed the "ApprovalStatus" and replaced with the xmlns. Also, based on the description of child:node(), I think, then it is required.
    Now I am getting following error
    ORA-30625: method dispatch on NULL SELF argument is disallowed
    Below is the complete code and underneath code I am providing response XML structure
    I can't thank you enough for tracking this post for so long. Thank you so much, I really appreciate your diligence.
    Code_
    DECLARE
    soap_request CLOB;
    soap_respond CLOB;
    v_resp VARCHAR2 (100);
    v_order VARCHAR2 (100);
    v_line_number VARCHAR2 (100);
    http_req UTL_HTTP.req;
    http_resp UTL_HTTP.resp;
    resp XMLTYPE;
    BEGIN
    soap_request :=
    '<?xml version="1.0" encoding="utf-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <NewOrder xmlns="urn:ws.xtech.net/xtechGateway">
    <newOrderRequest xsi:type="ns1:NewOrderRequestElement" xmlns:ns1="urn:ws.xtech.net/xtechGateway" xmlns="">
    <ns1:XConnectionUsername>'
    || 'xxxxxxx'
    || '</ns1:xalConnectionUsername>'
    || '<ns1:xalConnectionPassword>'
    || 'xxxxxxx'
    || '</ns1:xalConnectionPassword>'
    || '<ns1:industryType>'
    || 'EC'
    || '</ns1:industryType>'
    || '<ns1:transType>'
    || 'AC'
    || '</ns1:transType>'
    || '<ns1:bin>'
    || '000002'
    || '</ns1:bin>'
    || '<ns1:merchantID>'
    || 700000208789
    || '</ns1:merchantID>'
    || '<ns1:terminalID>'
    || 001
    || '</ns1:terminalID>'
    || '<ns1:ccAccountNum>'
    || '4x1xxxx11x11x1xx1'
    || '</ns1:ccAccountNum>'
    || '<ns1:ccExp>'
    || '122012'
    || '</ns1:ccExp>'
    || '<ns1:ccCardVerifyPresenceInd>'
    || 2
    || '</ns1:ccCardVerifyPresenceInd>'
    || '<ns1:avsZip>'
    || 'T2H 2K6'
    || '</ns1:avsZip>'
    || '<ns1:avsAddress1>'
    || '112-7015 MACLEOD TRAIL SW'
    || '</ns1:avsAddress1>'
    || '<ns1:avsAddress2>'
    || ''
    || '</ns1:avsAddress2>'
    || '<ns1:avsCity>'
    || 'CALGARY'
    || '</ns1:avsCity>'
    || '<ns1:avsState>'
    || ''
    || '</ns1:avsState>'
    || '<ns1:avsName>'
    || 'Testing'
    || '</ns1:avsName>'
    || '<ns1:avsCountryCode>'
    || 'CA'
    || '</ns1:avsCountryCode>'
    || '<ns1:orderID>'
    || '31103142361483'
    || '</ns1:orderID>'
    || '<ns1:amount>'
    || 100
    || '</ns1:amount>'
    || '<ns1:comments>'
    || 'This is a AE AVSCVV AuthCap'
    || '</ns1:comments>'
    || '</newOrderRequest>'
    || '</NewOrder>'
    || '</soapenv:Body>'
    || '</soapenv:Envelope>';
    UTL_HTTP.set_wallet ('file:/a01/oracle/devdb/9.2.0/appsutil/wallet',
    'p4ssword'
    http_req :=
    UTL_HTTP.begin_request
    ('https://wsvar.xtech.net/xtechGateway',
    'POST',
    'HTTP/1.1'
    UTL_HTTP.set_header (http_req, 'Content-Type', 'text/xml');
    UTL_HTTP.set_header (http_req, 'Content-Length', LENGTH (soap_request));
    UTL_HTTP.set_header (http_req, 'SOAPAction', 'xmlns="urn:ws.xtech.net/xtechGateway"');
    UTL_HTTP.write_text (http_req, soap_request);
    http_resp := UTL_HTTP.get_response (http_req);
    UTL_HTTP.read_text (http_resp, soap_respond);
    UTL_HTTP.end_response (http_resp);
    resp := XMLTYPE.createxml (soap_respond);
    resp :=
    resp.EXTRACT ('/soap:Envelope/soap:Body/child::node()',
    'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
    v_resp :=trunc(resp.EXTRACT ('/NewOrderResponse/return/text ()','xmlns:ns1="urn:ws.xtech.net/xtechGateway"').getstringval());
    DBMS_OUTPUT.put_line ('Response: ' || v_resp);
    END;
    XML Response Structure_
    <xml>
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="urn:ws.xtech.net/xtechGateway">
    <SOAP-ENV:Body id="_0">
    <NewOrderResponse xmlns="urn:ws.xtech.net/xtechGateway" xsi:type="ns:NewOrderResponse">
    <return xsi:type="ns:NewOrderResponseElement">
    <industryType xsi:type="xsd:string">EC</industryType>
    <transType xsi:type="xsd:string">AC</transType>
    <bin xsi:type="xsd:string">000001</bin>
    <merchantID xsi:type="xsd:string">041756</merchantID>
    <terminalID xsi:type="xsd:string">001</terminalID>
    <cardBrand xsi:type="xsd:string">DI</cardBrand>
    <orderID xsi:type="xsd:string">31103142361483</orderID>
    <txRefNum xsi:type="xsd:string">41C09DBC1D0710F4635C1156509F3CCF491F545E</txRefNum>
    <txRefIdx xsi:type="xsd:string">1</txRefIdx>
    <respDateTime xsi:type="xsd:string">20041215152533</respDateTime>
    <procStatus xsi:type="xsd:string">0</procStatus>
    <approvalStatus xsi:type="xsd:string">1</approvalStatus>
    <respCode xsi:type="xsd:string">00</respCode>
    <avsRespCode xsi:type="xsd:string">B </avsRespCode>
    <cvvRespCode xsi:type="xsd:string">P</cvvRespCode>
    <authorizationCode xsi:type="xsd:string">tst993</authorizationCode>
    <mcRecurringAdvCode xsi:type="xsd:string"/>
    <visaVbVRespCode xsi:type="xsd:string"/>
    <procStatusMessage xsi:type="xsd:string">Approved</procStatusMessage>
    <hostRespCode xsi:type="xsd:string">100</hostRespCode>
    <hostAVSRespCode xsi:type="xsd:string">I3</hostAVSRespCode>
    <hostCVVRespCode xsi:type="xsd:string">P</hostCVVRespCode>
    <retryAttempCount xsi:type="xsd:string"/>
    <lastRetryDate xsi:type="xsd:string"/>
    <customerRefNum xsi:type="xsd:string"/>
    <customerName xsi:type="xsd:string"/>
    <profileProcStatus xsi:type="xsd:string"/>
    <profileProcStatusMsg xsi:type="xsd:string"/>
    </return>
    </NewOrderResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope> </xml>
    Edited by: user2913945 on Mar 8, 2010 10:42 AM

  • ORA-31013: Invalid XPATH expression

    Hi,
    I am getting this error when i am trying to execute a sp which will do xml parsing.
    What all i did is i have Oracle database with 9.2.0.1.0 version. The i hav ugraded the database to 9.2.0.6.0 using the Oracle patch. After upgrading the Oracle db to 9.2.0.6.0 i got the below error:
    ORA-00600: internal error code,
    Then i ran the catpatch.sql to get rid off this error. After running the catpatch.sql the above error gone but i got another error
    ORA-31013: Invalid XPATH expression.
    What does this mean. The sp is working fine before upgrading the Oracle db to 9.2.0.6.0. Is the patch upgrade corrupted any of the XML libraries or the 9.2.0.6.0 doesn't support the xml parsing or do i need to apply any patch for this.
    Please suggest me ASAP since this error has been raised at cusotmer and i am in very much need of this.
    The statement which i am using for parsing the xml file is
    x.xml_data.extract('/x:recording/@x:ref').getStringVal() from xml_process;
    where xml_process is a table of xml_type.
    Thanks
    Rao

    Hello, There,
    Recently we have moved some project from 9ir2 to 10gr2, some code which worked fine before but now got error.
    any patch needed for this ? did anybody get the same issue before?
    here're my environment:
    1)9ir2:
    SQL> select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    PL/SQL Release 9.2.0.8.0 - Production
    CORE 9.2.0.8.0 Production
    TNS for Solaris: Version 9.2.0.8.0 - Production
    NLSRTL Version 9.2.0.8.0 - Production
    2) 10gr2:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    3) below are my test code which works fine in 9ir2 but got problem of "ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in..."
    ---===================TEST CODE START========================================
    var xml_data clob;
    begin
    :xml_data:='<?xml version="1.0" encoding="UTF-8"?>
    <MCCI_MT000100.Message xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <!-- NOTE
    The OID values and other values used in this message are not intended to be meaningful
    -->
    <id root="2.16.840.1.113883.4.3.57.100000126" extension="58212040112"/>
    <creationTime value="20030620"/>
    <versionId>v3r1b3</versionId>
    <!--
    this should be the interaction ID for "Invoice Adjudication Request"
    -->
    <interactionId root="2.16.840.1.113883.4.3.57.100000126" extension="FICR_IN600201"/>
    <processingCode code="P"/>
    <processingModeCode code="T"/>
    <!-- always send an acknowledgement -->
    <acceptAckCode code="AL"/>
    <!-- always send an acknowledgement -->
    <applicationAckCode code="AL"/>
    <communicationFunctionRcv>
    <typeCode code="RCV"/>
    <deviceRcv classCode="DEV" determinerCode="INSTANCE">
    <id root="2.16.840.1.113883.4.3.57.100000126" extension="111111111"/>
    <name use="L">BCE</name>
    </deviceRcv>
    </communicationFunctionRcv>
    <communicationFunctionSnd>
    <typeCode code="SND"/>
    <deviceSnd>
    <!-- note the defaulted classCode and determinerCode ere -->
    <id root="2.16.840.1.113883.4.3.57.100000126" extension="100000126"/>
    <name use="L">SampleProvider</name>
    </deviceSnd>
    </communicationFunctionSnd>
    <controlActProcess>
    <!-- 111111112 is Trading Network ID -->
    <id root="2.16.840.1.113883.4.3.57.100000126" extension="111111112"/>
    <effectiveTime value="20030620"/>
    <subject>
    <!-- element for invoiceadjudicationResults -->
    <invoiceAdjudicationRequest>
    <id root="2.16.840.1.113883.4.3.57.100000126" extension="58712040112"/>
    <amt currency="CAD" value="200"/>
    <reasonOf>
    <!-- group invoice #: only one -->
    <justifiedInvoiceElementOrder>
    <id extension="162" root="2.16.840.1.113883.4.3.57.100000126"/>
    <code code="CP"/>
    <!-- CP: Clinical Product; CS: Clinical Service -->
    <netAmt currency="CAD" value="200"/>
    <component>
    <InvoiceElementDetail>
    <id extension="162.1" root="2.16.840.1.113883.4.3.57.100000126"/>
    <code code="240"/> <!-- service code -->
    <unitQuantity>
    <numerator value="4" unit="h"/>
    <denominator value="1" unit="each"/>
    </unitQuantity>
    <unitPriceAmt>
    <numerator value="25" currency="CAD"/>
    <denominator value="1" unit="1"/>
    </unitPriceAmt>
    <netAmt currency="CAD" value="100"/>
    <reasonOf>
    <justifiedAct>
    <billableClinicalService>
    <code code="240"/>
    <!-- service code again, duplicate -->
    <!-- date of service -->
    <effectiveTime value="20030620"/>
    <performer>
    <healthCareProvider id ="100000126"/>
    <!-- idb provider id as responsible provider -->
    </performer>
    <location>
    <participant>
    <COCT_MT240000.ServiceDeliveryLocation>
    <code code="12"/>
    <!-- facilityTypecode -->
    </COCT_MT240000.ServiceDeliveryLocation>
    </participant>
    </location>
    </billableClinicalService>
    </justifiedAct>
    </reasonOf>
    </InvoiceElementDetail>
    </component>
    <component>
    <InvoiceElementDetail>
    <id extension="162.2" root="2.16.840.1.113883.4.3.57.100000126"/>
    <code code="240"/> <!-- service code -->
    <unitQuantity>
    <numerator value="4" unit="h"/>
    <denominator value="1" unit="each"/>
    </unitQuantity>
    <unitPriceAmt>
    <numerator value="25" currency="CAD"/>
    <denominator value="1" unit="1"/>
    </unitPriceAmt>
    <netAmt currency="CAD" value="100"/>
    <reasonOf>
    <justifiedAct>
    <billableClinicalService>
    <code code="240"/>
    <!-- service code again, duplicate -->
    <!-- date of service -->
    <effectiveTime value="20030620"/>
    <performer>
    <healthCareProvider id ="100000126"/>
    <!-- idb provider id as responsible provider -->
    </performer>
    <location>
    <participant>
    <COCT_MT240000.ServiceDeliveryLocation>
    <code code="12"/>
    <!-- facilityTypecode -->
    </COCT_MT240000.ServiceDeliveryLocation>
    </participant>
    </location>
    </billableClinicalService>
    </justifiedAct>
    </reasonOf>
    </InvoiceElementDetail>
    </component>
    <coverage>
    <coveringCoverageEvent>
    <id extension="1" root="2.16.840.1.113883.4.3.57.100000126"/>
    <code code="event"/>
    <beneficiary>
    <coveredParty>
    <!-- claim # -->
    <id extension="00012345" root="2.16.840.1.113883.4.3.57.100000126"/>
    <code code ="spouse"/>
    <coveredParty>
    <CoveredPartyAsPatientPerson>
    <name>
    <family>Jackson</family>
    <given>Robyn</given>
    </name>
    <administrativeGenderCode code="F"/>
    <birthTime value="19490601" />
    <deceasedTime value="20030123" />
    <multipleBirthInd value="false" />
    <multipleBirthOrderNumber value="1" />
    <addr>
    <postalCode>L1W3V4</postalCode>
    </addr>
    </CoveredPartyAsPatientPerson>
    </coveredParty>
    </coveredParty>
    </beneficiary>
    <author>
    <underwriter>
    <!-- Insurer ID -->
    <id extension="10001" root="2.16.840.1.113883.4.3.57.100000126"/>
    </underwriter>
    </author>
    </coveringCoverageEvent>
    </coverage>
    </justifiedInvoiceElementOrder>
    </reasonOf>
    </invoiceAdjudicationRequest>
    </subject>
    </controlActProcess>
    <attentionLine type="AttentionLine" assoc="inboundRelationship">
    <keyWordText code="BENEFITGR">Physio</keyWordText>
    </attentionLine>
    <attentionLine type="AttentionLine" assoc="inboundRelationship">
    <keyWordText code="TPID">111111112</keyWordText>
    </attentionLine>
    </MCCI_MT000100.Message>
    end;
    select extract(xmltype(:xml_data),'/MCCI_MT000100.Message/communicationFunctionSnd/deviceSnd/id@extension','xmlns="urn:hl7-org:v3"').getStringVal() from dual;
    --=====================TEST CODE END=======================================
    in 9ir2 the result is:
    SQL> select extract(xmltype(:xml_data),'/MCCI_MT000100.Message/communicationFunctionSnd/deviceSnd/id@extension','xmlns="urn:hl7-org:v3"').getStringVal(
    ) from dual ;
    EXTRACT(XMLTYPE(:XML_DATA),'/MCCI_MT000100.MESSAGE/COMMUNICATIONFUNCTIONSND/DEVI
    100000126
    but in 10gr2, the error show as below:
    SQL>
    SQL> select extract(xmltype(:xml_data),'/MCCI_MT000100.Message/communicationFunctionSnd/deviceSnd/id@extension','xmlns="urn:hl7-org:v3"').getStringVal(
    ) from dual ;
    select extract(xmltype(:xml_data),'/MCCI_MT000100.Message/communicationFunctionSnd/deviceSnd/id@extension','xmlns="urn:hl7-org:v3"').getStringVal() fro
    m dual
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in:
    '/MCCI_MT000100.Message/communicationFunctionSnd/deviceSnd/id@extension'
    thanks in advance!
    richard

  • Is it possible to call a java function from plsql?

    I have a plsql script which loads data in to a table. One of the fields is a notes field. I would like to use advance offerings of java to manipulate the data before inserting. Is there away I can pass the data to a java function and have it return the manipulated data?
    Thanks
    Aaron

    You can use java stored procedure to call java function from plsql.
    1. Create a java class with a static function(which will be called from plsql).
    2. Compile and load the class into database using LOADJAVA command.
    3. Create a wrapper stored procedure or function in plsql which calls the above java function.
    4. Access this plsql procedure like normal database procedure. This will invoke underlying java function in which you can do all the processing and return result.
    Refer this url for help on implementing above steps :
    http://otn.oracle.com/tech/java/jsp/pdf/developing_o8i_apps_with_plsql_and_java_twp.pdf
    Samples on java stored procedure :
    http://otn.oracle.com/sample_code/tech/java/jsp/oracle9ijsp.html
    Chandar

  • How to Call Function from SAPSCRIPT

    I want to Call a function from my SAPSCRIPT to get some data and print the same in the form , Can I get an example for this

    Hi Nandan,
    U cannot directly call function from SAPScript... For that u have to create one include in which u need to write the code. Using Perform... EndPerform u can call the same from SAPScript. See the below example
    u need to write this code in SAPScript
    PERFORM formname IN PROGRAM includename
    USING &field1&                                      
    USING &field2&                                      
    CHANGING &field3&                                     
    ENDPERFORM                                               
    Here includename is your include type program.
    u need to write this code in your include type program..
    FORM formname TABLES in_par STRUCTURE itcsy
                            out_par STRUCTURE itcsy.
    data : var1 like field1,
           var2 like field2,
           var3 like field3.
      READ TABLE in_par WITH KEY 'field1'.
      CHECK sy-subrc = 0.
      var1 = in_par-value.
      READ TABLE in_par WITH KEY 'field2'.
      CHECK sy-subrc = 0.
      var2 = in_par-value.
    now u can call corresponding function using local VAR1 and VAR2. Here u can pass N no of USING parameters.
    After processing on VAR3...
      READ TABLE out_par WITH KEY 'field3'.
      out_par-value = VAR3.
      MODIFY out_par INDEX sy-tabix.
    EndForm.
    Here in_par and out_par are the structures which will be used to communicate with SAPScript. And this is the only way as per my view.
    I m sure this code will work fine. Here i have used dummy variables that u need to change as per your requirement. If u have more queries write me back.
    And yes if this works than dont forget to give the points.
    Regards,
    Sagar

  • Call function from data base with clob input parameter.

    Hello,
    In this project I use Jdev 11g.
    I call function from database.
    create or replace function get_fa_list (
    p_fa_id_list in clob
    return sys_refcursor
    is
    vCursor sys_refcursor;
    begin
    put_msg ('begin');
    if p_fa_id_list is null then
    put_msg ('CLOB is null!');
    else
    put_msg ('size CLOB: ' || dbms_lob.getlength (p_fa_id_list));
    end if;
    put_msg ('Save');
    open vCursor for
    select rownum as id, s.*
    from (
    select f.latitude, f.longitude, count (distinct f.res_id) as res_count, count (*) as fa_count, 16711680 as color, res_concat_distinct (f.res_id) as station_list
    from mv_frequency_assignment f, table (SplitClob (p_fa_id_list, ',')) l
    where f.ext_system = 'BI' and
    f.ext_sys_id = l.column_value
    group by f.latitude, f.longitude
    ) s;
    put_msg ('Open and End');
    return vCursor;
    end get_fa_list;
    I use TopLink in ejb.
    i use follow code for call function and get result.
    public List<TmpResPoints> findAllPointsBI(String p_id){
    UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
    uow.beginEarlyTransaction();
    StoredFunctionCall call = new StoredFunctionCall();
    call.setProcedureName("get_fa_list");
    call.useUnnamedCursorOutputAsResultSet();
    ClobDomain c = new ClobDomain(p_id);
    //System.out.println(c.toString());
    call.addNamedArgumentValue("p_fa_id_list", c);
    ReadAllQuery query = new ReadAllQuery();
    query.setReferenceClass(TmpResPoints.class);
    query.setCall(call);
    List<TmpResPoints> result = (List<TmpResPoints>)uow.executeQuery(query);
    uow.commit();
    uow.release();
    return result;
    But size parameter "p_fa_id_list" is 0. (geting from temp table in Data base). this code in function >>
    if p_fa_id_list is null then
    put_msg ('CLOB is null!');
    else
    put_msg ('size CLOB: ' || dbms_lob.getlength (p_fa_id_list));
    end if;)
    How I can call this function from dataBase and get result?
    thx,
    Demka.

    What is the SQL generated?
    The argument should just be the Clob value (a String) not the domain object.
    Also try addNamedArgument, and then pass the named argument to the query.
    James : http://www.eclipselink.org

  • Send data to ECC table through RFC Call function from SAP B1 via  b1if

    Hi,
    I have created scenario in B1if which triggers from SAP B1, now I have to send this data in to ECC table, so I have created scenario for that with inbound SAP B1, outbound void and in process RFC Call atom is there but I am not getting data in receiver and also how to write xml to send data in RFC function. Function for RFC has configured from ECC end and have access of that function.
    So please help me to send data to ECC table through RFC Call function from SAP B1 (9.0) via b1if
    Thanks

    Solved by my own.

  • Calling function from sql folder vs report

    Hi,
    A report based on a custom sql folder is taking a long time to run. One of the things that I noticed is that when I run the sql in plsql it takes a long time, but if I remove the row where I call a function, it runs pretty quickly.
    In general, is there a difference between running a function from the sql custom folder and calling it from the report itself?
    Thanks.
    Leah

    Hi Tamir,
    I might check out the execution plans, but truthfully, understanding the plans and the meaning of the differences is not my strong point.
    I thought that maybe there was some general rule that, for instance, it is better to keep functions out of the sql folder and use them in a condition in the report itself, or the opposite, or that maybe it makes no difference at all.
    I appreciate the response.
    Thanks.
    Leah

  • Calling functions from a .JS file

    Good morning,
    I stored my Javascript functions in a .JS file and saved the file in the /i/javascript folder on my APEX server.
    In the HTML Header field I put the following code: <strong>&lt;script src="#IMAGE_PREFIX#javascript/P9001.js" type="text/javascript"&gt;&lt;/script&gt;</strong>.
    In the HTML Body Attribute field I put the following code: <strong>javascript: onLoad='P9001PageLoad()';</strong>
    When the page loads I get the error "<em>Object Expected</em>" on Line 21, Char 1. (When I view the source, line 21 is the line with the code from the HTML Body Attribute Field.)
    Also, in the source HTML of the page, line 17 has <strong>&lt;script src="/i/javascript/P9001.js" type="text/javascript"&gt;&lt;/script&gt;</strong> which I assume is how the APEX engine renders the code I typed into the HTML Header field, so I think that I typed it correctly.
    I am including the JS function that I am trying to call, but I do not believe there is a problem with the code. If I put the code into the Header Text Field then the function is called, and runs as expected. I beleive my issue has something to do with the JS files.
    function P9001PageLoad() {
    // Called on pageload to populate the Select Lists with the values in the
    // hidden fields. The Hidden fields are populated by P9001_PROC_PAGELOAD.
    var i = 1;
    var counter = 0;
    for (i=1;i&lt;=8;i++) {
    var slst_simp = document.getElementById("P9001_SLST_SIMPQS_Q" + i);
    var hidn_simp = document.getElementById("P9001_HIDN_SIMPQS_Q" + i);
    if (hidn_simp.value != parseInt(hidn_simp.value)) {
    slst_simp.value = null
    counter++
    else {
    slst_simp.value = hidn_simp.value
    if (counter &lt;8) {
    var i = 1;
    var counter = 0;
    for (i=1;i&lt;=8;i++) {
    var slst_simp = document.getElementById("P9001_SLST_SIMPQS_Q" + i);
    var hidn_simp = document.getElementById("P9001_HIDN_SIMPQS_Q" + i);
    if (hidn_simp.value != parseInt(hidn_simp.value)) {
    slst_simp.style.backgroundColor = "#dd0000"
    Any advice you can offer in helping me utilizing .JS files would be greatly appreciated! Thank you in advance.
    Donald Semensky.

    Hi,
    One other thing you should try - ensure that all command lines in the script end with ; eg:
    slst_simp.value = nullshould be:
    slst_simp.value = null;In some cases, this can actually cause errors further down in the code.
    You could simplify this test by creating a very small script:
    function test() {
    alert("Hello");
    }Run that in your onload and see if a message pops up. If it does, it means that your script contains errors that stops the script from being used and any call to it would return an invalid object type error message.
    Andy

  • Calling SP results in ORA-00911: invalid character

    I am testing a supposedly very simple stored procedure in XE. It compiles with no errors but when I enter the following command in the SQL Command window I get an ORA-00911: invalid character.
    call get_all_customer_orgs;
    The get_all_customer_orgs procedure is defined as...
    create or replace procedure get_all_customer_orgs (p_recordset out sys_refcursor)
    is
    begin
    open p_recordset for
    select * from customerorgs;
    end get_all_customer_orgs;
    I don't understand what the invalid character could be. Guidance? Thanks.

    I don't have XE handy, but your procedure works from SQL Plus (changing the table to emp).
    SQL> create or replace procedure get_all_customer_orgs (p_recordset out sys_refcursor)
      2  is
      3  begin
      4  open p_recordset for
      5  select empno,ename from emp;
      6  end get_all_customer_orgs;
      7  /
    Procedure created.
    SQL> var allemps refcursor
    SQL> exec get_all_customer_orgs(:allemps);
    PL/SQL procedure successfully completed.
    SQL> print allemps
                   EMPNO ENAME
                    7369 SMITH
                    7499 ALLEN
                    7521 WARD
                    7566 JONES
                    7654 MARTIN
                    7698 BLAKE
                    7782 CLARK
                    7788 SCOTT
                    7839 KING
                    7844 TURNER
                    7876 ADAMS
                    7900 JAMES
                    7902 FORD
                    7934 MILLER
    14 rows selected.

  • Call dll from plsql

    Hi
    I am trying to connect an external program(DLL) from pl/sql.
    for the practice i trying to call "GetComputerName" from kernel32.dll.
    i made the following step
    1. Creating a library .
    2. Creating a package .
    3. Set the listener.ora
    4. Set the tnsnames.ora.
    After solving the problame with the settings of the listener.ora
    I testing the function , it run with no error but return 'null' .
    I thing the problems is with the "parameter"
    I do not know of haw to send them .
    ----my pak-------------------------------
    CREATE OR REPLACE Package Body K32 As
    Function GetComputerNameK(lpBuffer out varchar2,nSize in out long )Return long Is
    External
    Library Sys.Kernel32 Name "GetComputerNameW"
    Language c
              WITH CONTEXT
    PARAMETERS (
    CONTEXT,
    --lpBuffer STRING,
              lpBuffer BY REFERENCE,
              nSize BY REFERENCE,
              --nSize INDICATOR short,*/
              RETURN INDICATOR--,
         /*     RETURN short */);
    End K32;

    Let me explain a bit what a VFP DLL is for:
    You can only build one type of DLL, an OLE COM Server DLL. It'll mainly contain OLEPUBLIC class definitions, which are then usable in other programming languages. In any programming language capable to make use of OLE COM Server classes.
    If your project is named mydll.pjx and a prg or vcx contains a class myclass, the final DLL will have the OLE class "mydll.myclass" in it.
    This is overhead, if you use this in VFP. If you want to modularize your application, then create several EXE or build as APP. You can DO some.prg IN some.APP or you can create an object o = NEWOBJECT("myclass","myclasslib.vcx","myapp.app")
    to refer to a class inside a vcx compiled and build together with other project files into an app file.
    But any separation you do complicates the code use. A DLL is only needed, if some other programming language needs to use your VFP code. And that other programming language has to be able to instanciate classes.
    You don't need this, even if other programming languages would be involved. You can compile an EXE and that can be run. If needed with parameters. That's typically much simpler and could even be used by DOS batch files either using the DOS start command
    or directly your.EXE as man DOS commands also are merely EXE files.
    Bye, Olaf.
    Olaf Doschke - TMN Systemberatung GmbH http://www.tmn-systemberatung.de

  • Calling function from list of values section?

    can i call a function from list of values(LOV) section as well? I know we can sql query but udf is supported?

    See this recent thread: Display as Text (LOV) or join
    Scott

  • Calling function from PL/SQL block

    Hi,
    A very simple question.
    A have a function called "test1" in my database. It is there i double chekked.
    I would like to call this function from a block:
    DECLARE
    BEGIN
    TEST1(1202);
    END;
    This gives me an error.
    Why is this?

    user610868 wrote:
    Hi,
    A very simple question.
    A have a function called "test1" in my database. It is there i double chekked.
    I would like to call this function from a block:
    DECLARE
    BEGIN
    TEST1(1202);
    END;
    This gives me an error.
    Why is this?Hello
    A very very basic thing to do when you get an error is to include details of it. That helps narrow it down from one of the 1000s of potential Oracle errors it could be.
    Anyway, a function returns a value, and in PL/SQL you need to capture that otherwise you'll get "an error". Modify your code like so
    DECLARE
       l_Test1Val     VARCHAR2(4000); --CHANGE THIS TO BE THE SAME AS THE RETURN TYPE FOR YOUR FUNCTION
    BEGIN
       l_Test1Val :=  TEST1(1202);
    END;HTH
    David
    Edited by: Bravid on Oct 25, 2011 3:57 PM
    removed a ;

  • Executing Stored Procedure from TOAD: ORA-00900: invalid SQL statement

    Ok…I have ALL the stored procedures converted into Oracle…now, when I go to test them I am getting the vague error of:
    ORA-00900: invalid SQL statement
    I am attempting to execute:
    --EXEC IEXGetAgentSysPerf(to_date('2008/09/01', 'yyyy/mm/dd/'), to_date('2008/09/11', 'yyyy/mm/dd'), 'US HelpDesk');
    EXEC IEXGetAgentSysPerf('9/1/2008', '9/11/2008', 'US HelpDesk');
    (Neither work). These are calling a Stored Procedure with the following header:
         PROCEDURE IEXGetAgentSysPerf (
              v_curparm_IEXGetAgentSysPerf     IN OUT      pkg_IEX.cur_IEXGetAgentSysPerf
              ,v_BDateTime     DATE
              ,v_EDateTime     DATE
              ,v_WorkGroup     VARCHAR2
    The IDE is “TOAD” for Oracle. Thanks in advance.

    Hi,
    This is your procedure
    PROCEDURE IEXGetAgentSysPerf (
    v_curparm_IEXGetAgentSysPerf IN OUT pkg_IEX.cur_IEXGetAgentSysPerf
    ,v_BDateTime DATE
    ,v_EDateTime DATE
    ,v_WorkGroup VARCHAR2
    you are providing the ,v_BDateTime DATE,v_EDateTime DATE and v_WorkGroup
    and how about "v_curparm_IEXGetAgentSysPerf ". So that procedures is returning the error.
    Adding the the earlier post, If you want to test the Stored Procedures... then I say you work on the PL/SQL
    Developer which good for debugging (easy to use...) When compare to TOAD.. :-)
    Test ..it there...
    - Pavan Kumar N

  • Calling Functions From Import Integration Script

    I've got an import integration script that runs fine, however I also have several DataPump scripts that are used in FDM to change specific columns as they come in. I can take the code from the scripts and add to the Import Integration script, but I would rather just call those other functions from the VBScript. I don't see any docs on this, and I'm just wondering if anyone has done this or can describe how I can do it.
    Is it possible? Since the standard import scripts reference the strField and the strRecord, can these functions be called from the import integration script?

    strField and strRecord are arguments passed by the application to the import function. The represent the field as defined by the import format and the record that is being processed during the import.
    Given that, I'm not sure how to answer your question.

Maybe you are looking for

  • System.out.println in Web Dynpro Java

    I call System.out.println in some components in web dynpro java.  But I cannot find the standard console output file of SAP J2EE Engine. Anyone know where is the location of standard output file?

  • Perplexing Problem with Boris Title Crawl

    This has been an ongoing problem that occurs whenever I use Boris Title Crawl to create very simple titles (i.e lower third, scolling titles, etc). Within the HD sequence, the titles work as intended, but when I down convert the sequence or export th

  • Is there an upgrade price from 9.1.8

    Logic Pro X looks good, but it's expensive. Isn't it possible to upgrade from 9.1.8 for a more reasonable price? I can't find an upgrade option, but Apple is usually reasonable with this sort of thing.

  • Transfer of colors

    I have problems with the transfer of color from my photo album to my Deskjet 4280 printer. The magenta color does not transfer. I have copied a color phot on the printer and also e maild a copy to myself. In both case the colors were fine. This quest

  • Material with  item cat.group ERLA impact on costing and sales pricing

    Hello, I would like to know if a material which is defined as item category group ERLA and which has two sub-items posted in the BOM with usage 5 with its respective std cost could  be calculated for costing or not? Can I have some information about